Ubuntu: Non-root user login with key



Question:

I have the keys setup for the root user so I can login as root like so:

ssh -p xxxx root@xx.xx.xx.xx  

but I want to login as a non-root user john that I have created and verified, also set its home dir. Additionally, I also modified /etc/ssh/sshd_config to include:

AllowUsers john  

.. but I still get:

~> ssh -p xxxx john@xx.xx.xx.xx  Permission denied (publickey).  

What am I missing?


Solution:1

You should create ~/.ssh/authorized_keys in the desired user's home folder too. Even better, use ssh-copy-id.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »