I am having a similar issue to the author of opening post.
Followed these directions: https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04
Have added a new user to the server and added .ssh/authorized_keys . When I login with this new user I am still required to input password.
I would like to completely disable passwords and just use ssh. Does anyone know what the issue may be?
Anyone here using DSA keys and a Ubuntu 16.04 droplet (with OpenSSH 7.x by default) should note that DSA keys (pubkey starting with “ssh-dss”) are not accepted by default anymore. This issue caused problems very similar to ones described in the original question. This is understandable because if the keys are not accepted, the ssh reverts back to asking the password.
I had this problem when I created a new droplet. I had existing keys from previous droplets that were shown in the “Add SSH Keys (Optional)” section of the Create Droplet web interface. HOWEVER, I did not know I had to click them in order to enable them for the new droplet. I figured since they were shown that they were there. Upon closer inspection they did look kind of greyed out.
If you are using MacOSX:
sudo vi /etc/ssh_config
You should then edit these 2 lines to say:
PubkeyAuthentication yes RSAAuthentication yes
In case you might be using wrong file permissions on the server you should check those, whereas user is the user with whom you want to login:
chown -R user:user .ssh chmod -R .ssh chmod 600 .ssh/authorized_keys
Visit meshfields.de for more great tips and tutorials.
If you can’t figure out, why you’re not able to login via ssh try to debug it with command:
ssh -v firstname.lastname@example.org
Possible it helps:
All the directories starting from root and up to the .ssh directory in your home directory must not have write permission for either ‘group’ or 'other’
chmod g-w,o-w ~/.ssh chmod g-w,o-w ~./ssh/authorized_keys
Can I login with only key pairs with my sudo user (not root user)? And if yes, how?
When I created the droplet I connected my previously added keys by checking the checkbox under “Add your SSH keys”. When I logged in as root it worked fine with the added keys. I added a new sudo user, switched to that account and added the public key to the sudo user (password free private key).
usermod -aG sudo
su - newuser
chmod 700 ~/.ssh
Inserted public key
chmod 600 ~/.ssh/authorizedkeys
chown newuser -R ~/.ssh
But when I do the below command:
sudo nano /etc/ssh/sshd_config
The console now asks for password (the keys are password free).