git pull code error, agent refused operation: sign_and_send_pubkey: signing failed: agent refused operation

After updating ubuntu16.04 to 18.04, use git to pull the server code, and encounter the error of "sign_and_send_pubkey: signing failed: agent refused operation" rejected by the agent:

... A new repo command (  2.3) is available.
... You should upgrade soon:

    cp /android13/work_dir/.repo/repo/repo /usr/bin/repo

sign_and_send_pubkey: signing failed: agent refused operation
[email protected]: Permission denied (publickey).
sign_and_send_pubkey: signing failed: agent refused operation
[email protected]: Permission denied (pub lickey).
fatal: Unable to read the remote repository.

Please make sure you have the correct access permissions and the repository exists.

First check that the public key added on the code server is consistent with the file "~/.ssh/id_rsa.pub" in the local machine.

Finally, it was found that it was caused by the permission problem of the local .ssh public and private key files.

The way to fix this is to make sure you have the~/.ssh目录下的id_rsa和id_rsa.pub文件有正确的权限:

To change the permissions of a file, use the command:

sudo chmod 600 ~/.ssh/id_rsa
sudo chmod 644 ~/.ssh/id_rsa.pub

This solved my git code update problem

Guess you like

Origin blog.csdn.net/u013301596/article/details/131087424