Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
  1. created public/private keys using puttygen on my computer.
  2. put the public key in the .ssh/authorized_keys folder on the server
  3. setup pageant.exe to use the pk on my computer.
  4. when I run pageant, and connecting using putty it still asks me for my password.

what am I missing?

I did do a: chmod 700 on .ssh folder chmod 600 on authorized_keys file

thanks!

share|improve this question

6 Answers 6

Check your /var/log/secure or /var/log/auth on the Linux server for information why the key is not accepted.

Also, is the .ssh directory in the homedir of (and owned by) the user you are using to connect?

If you want to connect with the root user, it might be disabled in /etc/ssh/sshd_config.

share|improve this answer
    
OMG Thank you so much. I had two servers with identical configs. Pubkey worked on one and not the other. Was driving me insane. /var/log/auth said that permissions on my home folder were the culprit. Never would have know about that log or thought to check home folder perms. I only checked the ~/.ssh perms and such. You saved me. –  Apreche Jun 7 '10 at 15:16

Note that public key authentication must be enabled in the SSH server config (usually /etc/ssh/sshd_config). Check for the line:

 RSAAuthentication yes

then restart the SSH server.

If that does not help, try debugging the problem, by running the server in debug mode (if you can). Here's a tutorial:

http://blog.codefront.net/2007/02/28/debugging-ssh-public-key-authentication-problems/

share|improve this answer

Make sure the permissions are correct on the keys and authorized keys files on the server.

chmod 700 ~/.ssh
chmod 600 ~/.ssh/*
share|improve this answer
    
This is the issue I've most frequently been bitten by after learning that Putty and OpenSSH use different formats for their key files. –  Olaf Mar 12 '10 at 7:33

Simple thing that burned me ... make sure your key is all on one (long) line in authorized_keys .

share|improve this answer

Looking at the reverse of your situation, I seem to recall that keys generated via ssh-keygen on Linux are not compatible with putty. One needs to first convert the keys using puttygen.exe (I think you can do this via the putty GUI).

So maybe you could try:

  1. Use ssh-keygen to generate some keys on the server - do not save them to the server's .ssh directory.
  2. cat id_dsa.pub >> ~/.ssh/authorized_keys
  3. Copy the id_dsa.pub and id_dsa to your computer.
  4. Use putty to convert them to the appropriate format.
  5. Set those keys as the public and private ones for your computer.
share|improve this answer

I seem to recall having problems when the users home directory was group/world readable. This blocked the key from working.

share|improve this answer

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.