SSH RSA key with non-root user

rsasshuser-accounts

I'm trying to secure my VPS (running Ubuntu 10.04) so I'm trying to use RSA authentication, obviously I don't want to be logging in as root, so I disabled PermitRootLogin but I also disabled PasswordAuthentication

My question is, how can I get my RSA key to authenticate with a regular user. Like I said, I got it to work with root while I had those settings enabled, but I have no idea how to make it work without them on, with a regular user.

Best Answer

You should be able to put the public key in ~/.ssh/authorized_keys or ~/.ssh/authorized_keys2 (mode 600) and have it work just like it does with the root account.

Execute these commands to correct permissions

chmod 600 ~/.ssh/authorized_keys2
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
Related Question