Using Amazon Linux. Just added a user, rebooted the machine, but still am getting prompted for a password when that user tries to SSH into the machine. We have veriffied that the authorized_keys are set up with perrmissions outlined here -- https://unix.stackexchange.com/questions/36540/why-am-i-still-getting-a-password-prompt-with-ssh-with-public-key-authentication, The permissions for the ~/.ssh directory from the client machine (also Amazon Linux) are as such:

drwx------ 2 couser cogroup 4096 Mar 22 14:53 .
drwx------ 3 couser cogroup 4096 Mar 22 14:44 ..
-rw-r--r-- 1 couser cogroup  255 Mar 22 14:46 authorized_keys
-rw------- 1 couser cogroup  887 Mar 22 14:53 id_rsa
-rw-r--r-- 1 couser cogroup  243 Mar 22 14:53 id_rsa.pub
-rw-r--r-- 1 couser cogroup 1332 Mar 21 15:30 known_hosts

then on the remote machine the permissions on the ~/.ssh are

[adminuser@remotemachine ~]$ sudo ls -al /home/couser/.ssh
total 12
drwx------ 2 couser cogroup  4096 Mar 22 14:58 .
drwx------ 3 couser couser 4096 Mar 22 14:54 ..
-rw------- 1 couser cogroup   499 Mar 22 14:58 authorized_keys

Is there any other setting I need to enable for the user to allow them to SSH into the remote machine without being prompted for a password?

  • can you confirm that the authorized_keys on the remote machine holds the content of the id_rsa.pub from the client machine? – Yaron Mar 22 '17 at 15:52
  • are you able to login into the remote machine (using password), and check the content of the file, to make sure that it actually includes your public key? – Yaron Mar 22 '17 at 15:54
  • Post the verbose log from the connection, have a look to the errors on the server. – Jakuje Mar 22 '17 at 16:01
  • @Yaron, I'm not able to login on the remote machine using a password. What does that mean? – Dave Mar 22 '17 at 19:00
  • You did not write that your keys were generated without passphrase, but I guess you did. If not that would be the reason. Other your password is likely the login password of the target system, that would be standard behaviour. There is a setting - I believe in openssh server - that password authorizsation is set to "no". If you are connected to the internet be very careful that your key setup is 1000%, because SSH is the major target around the clock. I am sorry that I can not give the exact location of the setting, But I am quite sure its documented in the Ubuntu Wiki page for OpenSSH server. – CatMan Mar 22 '17 at 22:36

K, turned out the solution was to add the username to the


line of the



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.