I have a key ~/.ssh/id_rsa
and I added the pub key to my authorized keys:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
I also changed my permissions to 600:
sudo chmod 600 ~/.ssh/authorized_keys
I checked and /etc/ssh/sshd_config
is set for public key auth and has password auth as no.
PubkeyAuthentication yes
PasswordAuthentication no
I tried adding:
ssh-keyscan -t rsa localhost > /etc/ssh/ssh_known_hosts
I copied my id:
ssh-copy-id [email protected]
I restarted the service:
sudo service sshd restart
But despite all that, it still asks for a password! How can i make it not ask for one?
More Info:
When I do ssh localhost
it asks for a password, but when I do myusername@localhost
it works! Why is this?