On Sat, 22 Jun 2002, Richard wrote:

> Since an SSH package for Ruby doesn't exist right now, I have been
> trying to implement an SSH client through Ruby by sending text
> directly to the command line and retrieving the results. It's not
> working, though.

Just guessing, but I believe ssh implementations typically connect directly
to the tty in use for password/phrase queries for security.

This means that you need to use tools like expect or open a pty. Another
option would be to use keypairs that do not require passphrases, or a
daemon that supplies the passphrase provided it has already been provided
once.

The last option is AFAIK the secure & "correct" one. Look into ssh-agent.

The basic idea is to start the daemon and supply it manually with the
passphrase, which it stores in memory. After this the daemon supplies the
information for all future connections.

 -- Nikodemus