From: Takaaki Tateishi Date: 2002-01-12T20:55:55+09:00 Subject: Re: SSH + Ruby.... At Sat, 12 Jan 2002 17:41:26 +0900, Sean Chittenden wrote: > Anyone figured out how to use SSH + ruby in a way that lets me send a > password? One way I know is to use pty module like this: require 'pty' def ssh(host, passwd) PTY.spawn("/usr/local/bin/ssh #{host}"){|rio, wio, pid| wio.sync = true rio.expect(/^Password.*: /){ wio.print(passwd,"\n") } ... } end ssh("foo.org", "secret") -- Takaaki Tateishi