int port1 = getFreePort();
int port2 = getFreePort();
TestEchoShellFactory shellFactory = new TestEchoShellFactory();
ProxyAgentFactory agentFactory = new ProxyAgentFactory();
LocalAgentFactory localAgentFactory = new LocalAgentFactory();
KeyPair pair = new FileKeyPairProvider(new String[] { "src/test/resources/dsaprivkey.pem" }).loadKey(KeyPairProvider.SSH_DSS);
localAgentFactory.getAgent().addIdentity(pair, "smx");
SshServer sshd1 = SshServer.setUpDefaultServer();
sshd1.setPort(port1);
sshd1.setKeyPairProvider(new FileKeyPairProvider(new String[]{"src/test/resources/hostkey.pem"}));
sshd1.setShellFactory(shellFactory);