I have a ubuntu 16.04 server install that was initially installed with root user only so root users home directory is /root. If I add another user such as bob bobs home directory is created in /home/ as expected. If I want add a public key for bob to ssh in with, I add /home/bob/.ssh/authorized_keys and put bobs public key in the authorized key file. Is this the correct way so far? Problem is when I try
ssh bob@server.com
I get
Permission denied (publickey)
The .ssh directory permissions are set to 700 and the authorized_key file is set to 600. In my sshd_config the path to the key file is the default
#AuthorizedKeysFile %h/.ssh/authorized_keys
I set ssh logging to verbose but it only shows
Failed publickey for....
What could I be doing wrong? Is it only looking in /root/.ssh for the key file?
ssh -vvv bob@server.comand see why it is failing. – jasonwryan Sep 03 '17 at 01:32authorized_keysis free of spaces (in the actual keystring), line breaks, etc. – Patrick Sep 03 '17 at 01:50