-1

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?

1 Answer 1

0

It was using a different user from ~/.ssh/config than the one I was logged in as.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .