ssh permissions/setup: new user is prompted to use password on every login

October 28, 2015 1.5k views
Configuration Management Linux Basics Getting Started Ubuntu

Setup: Ubuntu WordPress on 14.04

Problem: new user is prompted to use password on every login

Context: I added the ssh key after droplet setup so I manually walked through the process of adding the public key to .ssh/authorized_keys within that users directory. All permissions that I know of have been properly set: .ssh = 700 and .ssh/authorized_keys = 600. What am I neglecting to do beyond this? I have double checked that I am referencing the correct key. The users Home directory appears to have proper permissions setup.

  • Hi,

    What are the permissions on the private key itself, inside of the .ssh/authorized_keys/ folder?
    If you are a root user, you can also stop ssh, and start it in debug mode, which may give you a better idea of what is causing the password prompt:

    service ssh stop      
    /bin/sshd -p <listening port> -D -d -e

    Then attempt to connect with the user you are troubleshooting at the port you specified, and watch the debug output for information.

  • Thanks for the response.

    Few things in reply, first, I wasn't aware that you could check the permissions of the key itself because authorized_keys is an actual file, not a folder containing keys. Next, only public keys are added to authorized_keys file.

    Last, I will try to debug as described above but again, I am a newbie to server config so I will have to read up on it a little first. But I will get back to you will any results.

    Again, thanks for your reply, it is much appreciated.

Be the first one to answer this question.