I am trying to login with an SSH key on Ubuntu but the problem is that, at login time, I am asked to enter the password instead of a passphrase key. I setup permission, generated a key multiple times, checked the /etc/ssh/sshd_config file:


ubuntu sshd[857]: Set /proc/self/oom_score_adj to 0
ubuntu sshd[857]: Connection from 192.168.1.x port 62310 on 192.168.1.x port 22

ubuntu:~$ ls -lar

drwx------   2 uadmin uadmin    .ssh
-rw-------  1  uadmin uadmin .ssh/authorized_keys

Please help me to understand what is the problem?


From the first glanse, your problem is obvious:

1) You are missing a private RSA (or DSA) key. Usually it is named id_rsa. To generate a pair of keys use ssh-keygen. A pharaphrase may be empty if you want to login without entering each time.

2) On remote host you must use a complimentary public RSA/DSA key, placed in ~/.ssh folder. Usually it is named id_rsa.pub. You may use ssh-copy-id tool.

In some rare cases, if server was configured specifically, you may need to check permissions of of $HOME and .ssh folders, and files located there. But, IMHO, it is an another story.

Best regards, Vitaly

  • I've generate new key pair and set permission and login with private key but still getting same error and also not get error like Server refuse key,passphase etc,,, like that. – Nullpointer Jul 1 '16 at 12:07
  • 1) Do you have another server to check the behaviour? 2) I would give a try to connect to another user account on the same machine. Just create a test account, set password, make sure you are able to login, then register a public key of your main account by ssh-copy-id -i ~/.ssh/id_rsa.pub test@localhost command, then try to use SSH to login as a test account user. 3) If nothing helps, just show us the output of the following command: ssh -vv login@host Good luck! – Demiurg Jul 1 '16 at 12:34
  • Yes it's working in another machine! – Nullpointer Jul 1 '16 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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