0

I can ssh to a server using my windows machine. There, I put the ssh key of my Linux machine (~/.ssh/id_rsa.pub) into the ~/.ssh/authorized_keys file. However, I cannot ssh to the server using my Linux machine:

$ ssh xyz@172.16.0.32


sign_and_send_pubkey: signing failed for RSA "/home/xyz/.ssh/id_rsa" from agent: agent refused operation
xyz@172.16.0.32: Permission denied (publickey).

What could I be doing wrong?

Edit:

I just applied

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

which did not have an effect on the issue.

3

2 Answers 2

0

I had to change the permissions of id_rsa and id_rsa.pub:

chmod 700 id_rsa*
0

The right permissions are

chmod 600 id_rsa         # rw-------
chmod 644 id_rsa.pub     # rw-r--r--

or using symbolic permissions:

chmod u=rw,go=  id_rsa
chmod u=rw,go=r id_rsa.pub

The .pub file is the public key, and it can be readable by anyone. It's only the private key which must have permissions restricted to the owner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.