Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an RSA key pair set up for authentication into my SSH server. The server is an Ubuntu Server, and I'm trying to log in using Putty on Windows. I load my private key into Pageant (the Putty authentication agent), and I attempt to log in. The server asks for my username, which I input. Then, I receive the error message: "Disconnected: no supported authentication methods available".

Next I tried sitting at my server machine and logging in directly with my username and password. Then, while still logged in to the host machine, I try to SSH into the server from the remote machine using the RSA key again. In this case, the login process works.

Can anyone please help me figure out why the key-based authentication only works if the user is already logged in to the host machine. Thank you.

share|improve this question
    
Did you import the same key you used to log in from the shell into Pageant or is it a different key? –  heavyd Sep 16 '10 at 2:05
add comment

2 Answers

up vote 3 down vote accepted

I've seen this happen when the user's home directory isn't local, but on an NFS automount on the network. If your home directory isn't already mounted when sshd goes to look for your ~/.ssh/authorized_keys, it won't be able to access it in time, so public-key-based authentication will fail.

share|improve this answer
    
Thank you. You were right. –  George Porter Sep 16 '10 at 2:20
    
If it isn't in pageant you can also specify it in Putty -> Connection -> SSH -> Auth -> private key for authentication (browse). –  Joshua D'Alton Apr 5 '13 at 7:56
add comment

Can't comment so...

If you stop the sshd service (service sshd stop) on your server you can run it interactively to get some debug output (sudo sshd -D). It may be related to the file protections on ~/.ssh and ~/.ssh/authorized_keys.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.