From: James Dinkel Date: 2008-04-17T00:41:33+09:00 Subject: Re: Windows, Net::SSH: how do I use a private key (w / passw Gordon Thiesfeld wrote: > On Wed, Apr 16, 2008 at 7:24 AM, Robert Dober > wrote: >> know it does not make a lot of sense but happened to me, but maybe the >> person sending me the key made an error on the client ( spelling as >> PuTTY ) >> HTH >> Robert > > Ok, the trick for me was to export the PuTTY private key to an OpenSSH > key in PuTTYgen, then cut and paste the public key into a file, rather > than using the "Save public key" button. > > C:\ruby\scripts\ssh_test>dir /b > key > key.pub > ssh.rb > > C:\ruby\scripts\ssh_test>ssh.rb > Wed Apr 16 10:01:24 CDT 2008 > > # ssh.rb > require 'net/ssh' > > Net::SSH.start( 'server' , :keys =>['key']) do |s| > s.process.popen3( "date" ){ |input, output, error| puts output.read > } > end Hey it works. I also added in the username parameter. Now the sucky thing is, it displays the password when typing it in. Anybody know how to hid the password while typing it? Either don't display anything, or replace each character with * ? -- Posted via http://www.ruby-forum.com/.