From: James Dinkel Date: 2008-04-16T14:33:19+09:00 Subject: Re: Windows, Net::SSH: how do I use a private key (w / passw Gordon Thiesfeld wrote: > On Tue, Apr 15, 2008 at 6:45 PM, Luis Lavena > wrote: >> > >> Windows (XP) box. >> > >> >> http://rubyforge.org/tracker/?atid=1126&group_id=274&func=browse >> >> -- >> Luis Lavena > > I think you can probably do this now, but there are some quirks. You > can pass in a :keys option to Net::SSH.start[1] and point it to your > keys (I think you need both the private and public key on your side). > Also, putty private keys aren't the same as OpenSSH keys. PuttyGen > has an option to convert to OpenSSH keys, but I didn't have any luck > using that with Net::SSH. Net::SSH does include a keygen tool > (rb-keygen) that I used to generate a set of keys, and after setting > up that pub key on the SSH server, I was able to connect. > > Hope that helps, > > Gordon > > [1] http://net-ssh.rubyforge.org/chapter-2.html#s3 I actually generated the key with ssh-keygen on the linux server (which needs to be converted to use with Putty, but I expect to use the unconverted key with the ruby script). What is the syntax of using the :key parameter? Is it like this? Net::SSH.start( 'files02', :keys=>['C:\\key_name'] ) do |session| assuming of course the key file is named 'key_name' and resides directly under the c: drive. Do you put in the name the public key to? (With Putty and openSSH clients I only need the private key on the client) -- Posted via http://www.ruby-forum.com/.