session.setConfig(props);
session.setDaemonThread(true);
// We have to make sure that SSH uses it's own socket factory so
// that we don't get recursion
SocketFactory sfactory = new SSHSocketFactory();
session.setSocketFactory(sfactory);
UserInfo userinfo = null;
session.setUserInfo(userinfo);
session.connect();
if (!session.isConnected()) {