int port1 = getFreePort();
int port2 = getFreePort();
TestEchoShellFactory shellFactory = new TestEchoShellFactory();
ProxyAgentFactory agentFactory = new ProxyAgentFactory();
LocalAgentFactory localAgentFactory = new LocalAgentFactory();
KeyPair pair = createTestKeyPairProvider("dsaprivkey.pem").loadKey(KeyPairProvider.SSH_DSS);
localAgentFactory.getAgent().addIdentity(pair, "smx");
SshServer sshd1 = SshServer.setUpDefaultServer();
sshd1.setPort(port1);
sshd1.setKeyPairProvider(Utils.createTestHostKeyProvider());
sshd1.setShellFactory(shellFactory);