Hi all,
following your past suggestions, I'm using Java 7u5 (currently running on
WinXP, but should have to work on 7 as well) to test my (S)FTP servers. They
both run and conecting through the IPv4 address I can use them, but I cannot
connect through the IPv6 address. I'm quite (85%) sure that Corporate has
turned off firewalls on this PC I'm using (on mine there are much more
problems) so they should work.
This is a sample code for SSSH/SFTP server. FileZilla says "Network error:
connection refused".
Have I done some misconfiguration? Suggestions?
final Logger LOG_SSHServer = LoggerFactory.getLogger(SimpleSsh.class);
final String USER_HOME =
System.getProperty(I18n.getString(Resources.PROP_HOME)) +
I18n.getString(Resources.USER_HOME);
final String USED_KEY = "key00.ser";
final String KEY_SERIAL = "key.ser";
final int PORT = 22;
SshServer sshServer;
final String USERNAME = "username";
final String PASSWORD = "password";
sshServer = SshServer.setUpDefaultServer();
sshServer.setPort(PORT);
// sshServer.setReuseAddress(true);
final String keyGen = USER_HOME + '/' + KEY_SERIAL;
if (SecurityUtils.isBouncyCastleRegistered()) {
sshServer.setKeyPairProvider(new
PEMGeneratorHostKeyProvider(keyGen, "RSA", 2048));
} else {
sshServer.setKeyPairProvider(
new FileKeyPairProvider(new String[] { keyGen }));
}
sshServer.setPasswordAuthenticator(new
CustomPasswordAuthenticator(USERNAME, PASSWORD));
sshServer.setSubsystemFactories(Collections.<NamedFactory<Command>>singletonList(new
SftpSubsystem.Factory()));
sshServer.setFileSystemFactory(new CustomFileSystemFactory(USER_HOME));
try {
sshServer.start();
} catch (final IOException iOE) {
LOG_SSHServer.error(iOE.getLocalizedMessage(), iOE);
}