sshd.setPort(port);
sshd.setKeyPairProvider(new FileKeyPairProvider(new String[] { "/etc/ssh_host_rsa_key", "/etc/ssh_host_dsa_key" }));
//sshd.setShellFactory(new ProcessShellFactory(new String[] { "/usr/bin/login", "-f", "-h", "localhost", "$USER", "/bin/sh", "-i" }));
sshd.setShellFactory(new ProcessShellFactory(new String[] { "/bin/sh", "-i", "-l" }));
//sshd.setPasswordAuthenticator(new PAMPasswordAuthenticator());
sshd.setPasswordAuthenticator(new PasswordAuthenticator() {
public Object authenticate(String username, String password, ServerSession session) {
return (username != null && username.equals(password)) ? username : null;
}
});
sshd.start();