I appreciate this is a recurring question, but I'm really struggling to get my SSH connection password-less irrespective of the many threads and changes I've done so far. I do remember this was once used to work fine.
On my local Mac (Catalina)
- my keys are in the ~.ssh folder which has permissions set to 700
- files have 600 permission
- everything is own by my user
I have also created a config file as
Host MyRemoteHost HostName 220.127.116.11 User myself PasswordAuthentication no PreferredAuthentications=publickey IdentityFile ~/.ssh/id_rsa
On the remote server, Ubuntu
- the pub key is in the ~.ssh/authorized_keys
- permission on the above is 600
- I've amended the ssh_config file in /etc/ssh by adding a
PreferredAuthentications publickey,passwordas I thought it was the only bit missing, although here the file is owned by the root user.
Just in case I have re-created the local RSA key using a 4096 bytes length.
When SSH in verbose mode, I can ultimately see the private key mode is used, but I was remembering/expecting for a no password prompt at all.
Am I wrong?