我的环境是阿里云centos7。
1、生成ssh-key
,填入自己的邮箱
ssh-keygen -t rsa -C "xxxxxx@"
2、进入ssh
目录
cd ~/.ssh
3、查看文件
ls
会看到列举出了有id_rsa
、id_rsa.pub
。
4、复制一下id_rsa.pub
文件内容
cat id_rsa.pub
5、打开github
中的SSH and GPS keys
选项,新增SSH key
,添加完成需要再次输入github
密码验证。
6、在自己的终端测试一下吧,使用ssh -T git@
[root@iZuf60c5nb7ulqwzl2jwbsZ .ssh]# ssh -T git@The authenticity of host ' (13.229.188.59)' can't be established.RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.RSA key fingerprint is MD5: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)? yesWarning: Permanently added ',13.229.188.59' (RSA) to the list of known hosts.Hi solocao! You've successfully authenticated, but GitHub does not provide shell access.[root@iZuf60c5nb7ulqwzl2jwbsZ .ssh]# ssh -T git@Warning: Permanently added the RSA host key for IP address '13.250.177.223' to the list of known hosts.Hi solocao! You've successfully authenticated, but GitHub does not provide shell access.
如果觉得《centos 生成 ssh-key github 连接 配置》对你有帮助,请点赞、收藏,并留下你的观点哦!