I would be usefull to have an API for the SSH client, so it could be used from other programs. Java-stype pseudo code: // create connections and forward ports SSHClient ssh = new SSHClient(); ssh.setUserAuthenticationHandler(new PasswordDialog()); ssh.setHostAuthenticationHandler(this); SSHSocket con = ssh.connect("127.0.0.1"); con.getOutputStream().write("hello".getBytes()); ssh.localForward(80, "www.google.com", 80); ssh.remoteForward(80, "www.google.com", 80); // access configuration SSHConfiguration sshConfig = ssh.getConfiguration(); SSHHostConfiguration hc = sshConfig.getHostConfiguration("*.ssh.box"); hc.setForwardX11(true); sshConfig.write(); // manage keys SSHKey key = SSHKeymanager.createKey(SSHKey.DSA, "apan-ola@foo.bar"); key.write("key1"); // creates ~/.ssh/key1 and ~/.ssh/key1.pub SSHKeymanager.removeKey("key1"); Collection keys = SSHKeymanager.listKeys();
*** Bug 1793 has been marked as a duplicate of this bug. ***