PuTTy keys are not identical in format to OpenSSH keys. There is a way to convert them to OpenSSH format (which is what Net::SSH wants) but I don't know it off the top of my head. :(
That said, if you have pageant installed, you might as well just let it handle the keys. If pageant is running, Net::SSH will automatically try to talk to it, and let it do the key management. - Jamis On 7/4/07, cornflakesuperstar <[EMAIL PROTECTED]> wrote: > > Hey Jamis, > > Yeah, I am having the same problem also when trying to cap_setup to > Amazon EC2 via capistrano from my windows XP box. It's been bugging me > all day =[ > > Maybe it's got something to do with the way the key was generated: > http://docs.amazonwebservices.com/AmazonEC2/gsg/2006-06-26/running-an-instance.html > > The key works fine with pageant and putty for bypassing authentication > of ssh/scp but doesn't seem to like the Net::SSH package. > > I added some logging into Net::SSH::UserAuth.wait_for_message which > shows where Net::SSH::UserAuth::Constants.USERAUTH_FAILURE is coming > back (and a prior response along the lines of 'fssh-userauth', 6): > > C:\workspace\blah>ruby utils/ssh-client.rb > [EMAIL PROTECTED] > -1.amazonaws.com --trace > connection to ec2-72-44-56-119.z-1.compute-1.amazonaws.com, 22 > waiting for message > waiting for message > got back #<OpenStruct buffer=#<Net::SSH::Transport::OSSL::ReaderBuffer: > 0x4e33fc4 > @content="\006\000\000\000\fssh-userauth", @position=1>, > message_type=6> > waiting for message > waiting for message > got back #<OpenStruct buffer=#<Net::SSH::Transport::OSSL::ReaderBuffer: > 0x4e01aec > @content="3\000\000\000\"publickey,gssapi-with-mic,password\000", > @position=1>, > message_type=51> > c:/ruby/lib/ruby/gems/1.8/gems/net-ssh-1.0.10/lib/net/ssh/session.rb: > 134:in `ini > tialize': app (Net::SSH::AuthenticationFailed) > from c:/ruby/lib/ruby/gems/1.8/gems/net-ssh-1.0.10/lib/net/ > ssh.rb:47:in > `start' > from utils/ssh-client.rb:46 > > On Jun 27, 10:03 am, "Jamis Buck" <[EMAIL PROTECTED]> wrote: > > Strange. Looking at the code, you'd see the behavior you'reseeing if > > (1) the file in question is not readable by Capistrano for some reason > > (permissions, etc.), or (2) if thekeyis not actually being added to > > the Net::SSHkeymanager for some reason. > > > > I can't duplicate theproblemhere. Has anyone else seen this behavior? > > > > - Jamis > > > > On 6/27/07, Feurio <[EMAIL PROTECTED]> wrote: > > > > > > > > > It is a SSH-2 RSAkeygenerated with PuttyKeyGenerator. > > > > > Feurio > > > > > On 27 Jun., 18:17, "Jamis Buck" <[EMAIL PROTECTED]> wrote: > > > > What kind ofkeyis it? DSS? RSA? Note that Net::SSH does not support > > > > RSA1 keys, so you need to make sure it is either DSS or RSA. > > > > > > - Jamis > > > > > > On 6/27/07, Feurio <[EMAIL PROTECTED]> wrote: > > > > > > > Hi Jamis, > > > > > > > c:/ is the directory and test_neu is the filename. > > > > > Actually the filename is test_neu.pub > > > > > But I left the .pub because capistrano seems to add it automatically. > > > > > > > Feurio > > > > > > > On 27 Jun., 16:08, "Jamis Buck" <[EMAIL PROTECTED]> wrote: > > > > > > Is c:/test_neu a directory containing your keys, or is it akeyfile > > > > > > itself? Note that the :keys option must point to an array of actual > > > > > >keyfilenames, and not just a directory where they exist. > > > > > > > > - Jamis > > > > > > > > On 6/27/07, Feurio <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hello, > > > > > > > > > I do have aproblemwith doingauthentificationviapublic/privatekey > > > > > > >filesand the ssh_options[:keys] in the capfile. > > > > > > > > > My environment: > > > > > > > > > Windows XP SP2 on the client side > > > > > > > capistrano 1.4.1 (cause I cannot install cap 2 because of > > > > > > > streaming > > > > > > > buffer error) > > > > > > > net-ssh 1.1.2 > > > > > > > SSH-1.99-OpenSSH_3.6.1p2 (on the server side) > > > > > > > > > Everything works if I use pagent for managing my privatekeyfile!!! > > > > > > > > > But if I want to work without pagent and only with the options in > > > > > > > the > > > > > > > cap (deploy.rb)-File it won' t accept the privatekey. > > > > > > > > > In my cap-file I have: > > > > > > > > > ssh_options[:keys] = %w(C:/test_neu) > > > > > > > > > After switching ssh debugging on I get the following: > > > > > > > ... > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- transport.session: got > > > > > > > packet of type 33 > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- transport.session: > > > > > > > sending > > > > > > > message >>"\025"<< > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- transport.session: > > > > > > > waiting > > > > > > > for packet from server... > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- > > > > > > > transport.incoming_packet_stream: reading 8 bytes from socket... > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- > > > > > > > transport.incoming_packet_stream: packet length(12) remaining(8) > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- > > > > > > > transport.incoming_packet_stream: received: "\025" > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- transport.session: got > > > > > > > packet of type 21 > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- transport.session: > > > > > > > sending > > > > > > > message >>"\005\000\000\000\fssh-userauth"<< > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- transport.session: > > > > > > > waiting > > > > > > > for packet from server... > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- > > > > > > > transport.incoming_packet_stream: reading 8 bytes from socket... > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- > > > > > > > transport.incoming_packet_stream: packet length(28) remaining(24) > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- > > > > > > > transport.incoming_packet_stream: received: > > > > > > > "\006\000\000\000\fssh- > > > > > > > userauth" > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- transport.session: got > > > > > > > packet of type 6 > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- userauth.driver: trying > > > > > > > "publickey" > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- userauth.driver: trying > > > > > > > "hostbased" > > > > > > > [DEBUG] Wed Jun 27 12:19:49 +0200 2007 -- userauth.driver: all > > > > > > > authorization methods failed > > > > > > > Password: > > > > > --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
