OpenSSH linkable library

Thomas Wouters thomas at xs4all.net
Wed Sep 19 08:58:38 EST 2001


On Tue, Sep 18, 2001 at 04:35:38PM -0500, Brian Hamon wrote:

> One technique that will work is to run ssh as a coprocess, with stdin and 
> stdout piped into your main process (similar to popen). The most important 
> consequence is that the password prompt will not work correctly (it uses 
> the pty directly, rather than stdin/stdout). Password authentication is 
> therefore not usable without adding unsavory patches to the OpenSSH source 
> code.

This isn't really true. You can't do it by just fiddling stdin/stdout, true,
but I wrote a very small Python script that allocates a pty/tty pair and
just dumps the password to that. Worked for both ssh and unzip (before it
grew a -P to get the password from the cmdline.) It used the 'pty' module,
which is not as portable as the pty code in OpenSSH, but comes pretty close.

Doing it in other languages might be a bit trickier, but is definately not
impossible, and almost certainly a lot easier than rearranging OpenSSH to
provide a public API ;P

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!



More information about the openssh-unix-dev mailing list