-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
With 1.0.9net/ssh I get:
irb(main):008:0> s = Net::SSH.start( ''jboss'',
''zdennis'' ) do |session| ; end; true
Enter password for /home/zdennis/.ssh/id_dsa:
=> true
You say it works for your app''s user account via command line? Are you
switching to that user, and ssh''ing into the server box?
Can you become that user and give us output of:
ssh -vv user at server
What are the permissions for the .ssh directory and files for your
app''s account for both client and server?
Zach
Jesse Clark wrote:> Hello All,
>
> I am having a problem getting Net::SSH to authenticate using preshared
> keys and was wondering if anyone could offer some insight as to what
> might be causing it.
>
> I have two users on my development box ( running os X ), one is my
> normal account, one is an account I created for the application to use.
>
> I used ''ssh-keygen -t dsa'' to generate key pairs for both
users.
>
> The permissions for all items in both .ssh directories are exactly the
same.
>
> I have two accounts on my remote testing machine ( RHEL3 ) with
> identical usernames to those on the development machine. For each of the
> accounts on the remote machine I added the contents of id_dsa.pub from
> each of the local accounts to .ssh/authorized_keys on the corresponding
> remote
> accounts.
>
> I can successfully ssh without being prompted for a password using ssh
> on the command line from both accounts on the development machine.
>
> However, when I attempt to connect from within my application using:
>
> Net::SSH.start( ''my.remote.host'',
''user'' ) do |session|
> ...
> end
>
> I can successfully connect with my normal user account, but the account
> I created for the application to use gives:
>
> Net::SSH::AuthenticationFailed in DriversController#test_ssh
>
/opt/local/lib/ruby/gems/1.8/gems/net-ssh-1.0.9/lib/net/ssh/session.rb:129:in
> `initialize''
> /opt/local/lib/ruby/gems/1.8/gems/net-ssh-1.0.9/lib/net/ssh.rb:47:in
`start''
> #{RAILS_ROOT}/app/controllers/drivers_controller.rb:166:in
`test_ssh''
>
> This very puzzling since I can connect successfully from the command line.
>
> I have checked and double checked permissions and groups and every other
> possible difference between the two accounts on the remote machine to
> make sure the accounts are setup identically.
>
> I also tried creating a third set of users and keys which also fails.
>
> I have also verified that I can connect using the form of Net::SSH.start
> which takes the password.
>
> Sorry for the long winded post. Any help would be much appreciated as I
> would prefer not to store passwords in application code.
>
> Thanks,
> -Jesse
> _______________________________________________
> Net-ssh-users mailing list
> Net-ssh-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/net-ssh-users
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEwRl9Myx0fW1d8G0RAt/LAJ0SB6a1peOmfnUGFq/9mS24Y/AnIQCfT/P9
BgWMZxOCvJTJTFWSk+e9vOU=LxFS
-----END PGP SIGNATURE-----