关于.ssh出错,无法从远程git仓库拉代码

时间:2023-03-08 16:29:40

背景:从windows开发环境改到ubuntu,将windows下生成的.ssh文件拷贝到ubuntu下,以clone远程git仓库代码

错误:sign_and_send_pubkey: signing failed: agent refused operation

解决方法:

ssh-agent -s
ssh-add

错误:Permissions 0664 for '/home/root/.ssh/id_rsa' are too open

解决方法:

sudo chmod 600 id_rsa
sudo chmod 600 id_rsa.pub
sudo chmod 600 known_hosts