System.err.println("Starting SSHD on port " + port);
SshServer sshd = SshServer.setUpDefaultServer();
sshd.setPort(port);
if (SecurityUtils.isBouncyCastleRegistered()) {
sshd.setKeyPairProvider(new PEMGeneratorHostKeyProvider("key.pem"));
} else {
sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("key.ser"));
}
if (System.getProperty("os.name").toLowerCase().indexOf("windows") < 0) {
sshd.setShellFactory(new ProcessShellFactory(new String[] { "/bin/sh", "-i", "-l" },