原因是检查本地没有SSH Key存在
1.首先为系统设置github的用户名和自己的邮箱
git config --global user.name "****"
git config --global user.email "****@xxx.com"
2.生成ssh key,邮箱填刚才设置的邮箱
ssh-keygen -t rsa -C "****@xxx.com
之后显示:
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):
可以全部按回车选择默认选项
3.打开.ssh文件夹下的id_rsa.pub 复制其内容
4.进入自己的github账户,打开设置
5.选择SSH and GPG keys选项
6.选择New SSH key
7.将刚才文件里的内容复制入框并点击add SSH key
8.在ubuntu中执行
ssh -T git@github.com