You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The authenticity of host 'github.com (IP ADDRESS)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?
The authenticity of host 'github.com (IP ADDRESS)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
则输入yes。
Hi username! You've successfully authenticated, but GitHub does not
provide shell access.
看到以上提示信息表示连接成功。
此时clone或者提交代码时就不需要再输入密码了。但是要注意的是,clone的代码请选择Clone With SSH。
MAC添加GitHub SSH验证
查看本地是否已经存在SSH文件
生成SSH KEY
ssh-keygen -t rsa -b 4096 -C "[email protected]"
-C后面是生成的公有key标识,可以随意写。
生成的文件默认路径是
/Users/you/.ssh/id_rsa
,此处会询问是否添加密码,我直接跳过了。you
是你电脑的用户名。添加SSH KEY到ssh-agent
因为我电脑版本是 macOS Sierra 10.12.6,所以直接通过
~/.ssh/config
管理。在config中添加以下配置
添加本地公有key到github
复制id_rsa.pub的内容,在github的Setting > SSH and GPG keys > SSH keys按钮下新建一个SSH key,
并将内容粘贴到Key输入框中。至此所有操作完成。
测试SSH连接
如果看到以下警告
则输入yes。
看到以上提示信息表示连接成功。
此时clone或者提交代码时就不需要再输入密码了。但是要注意的是,clone的代码请选择
Clone With SSH
。详细教程
官网
The text was updated successfully, but these errors were encountered: