执行 sudo git push -u origin master时出现错误 Permission denied (public key) 。git
1.添加个人密钥,使用命令:github
ssh-add ~/learngit/tavenssh
2.使用ssh -v git@github.com测试,能够看到验证经过:
debug1: Authentication succeeded (publickey).测试
待解决问题ui
taven@taven-Aspire-E5-551G:~$ ssh-add ~/learngit/taven.pub
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/home/taven/learngit/taven.pub' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
taven@taven-Aspire-E5-551G:~$ cd learngit/
taven@taven-Aspire-E5-551G:~/learngit$ ls
readme.txt taven taven.pub
taven@taven-Aspire-E5-551G:~/learngit$ sudo git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
taven@taven-Aspire-E5-551G:~/learngit$
spa