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 [email protected]

sign_and_send_pubkey: signing failed for RSA "/home/xyz/.ssh/id_rsa" from agent: agent refused operation
[email protected]: Permission denied (publickey).

What could I be doing wrong?


I just applied

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

which did not have an effect on the issue.


2 Answers 2


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

chmod 700 id_rsa*

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.

You must log in to answer this question.

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