Bug 436 - SSH client API
Summary: SSH client API
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: -current
Hardware: All All
: P2 enhancement
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
: 1793 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-11-15 01:33 AEDT by Jens
Modified: 2010-08-27 10:33 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens 2002-11-15 01:33:13 AEDT
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();
Comment 1 Damien Miller 2010-08-27 10:33:21 AEST
*** Bug 1793 has been marked as a duplicate of this bug. ***