centos 生成 ssh-key github 连接 配置

我的环境是阿里云centos7。

1、生成ssh-key,填入自己的邮箱

ssh-keygen -t rsa -C "xxxxxx@126.com"

2、进入ssh目录

cd ~/.ssh

3、查看文件

ls

会看到列举出了有id_rsaid_rsa.pub
4、复制一下id_rsa.pub文件内容

cat id_rsa.pub

5、打开github中的SSH and GPS keys选项,新增SSH key,添加完成需要再次输入github密码验证。
6、在自己的终端测试一下吧,使用ssh -T git@github.com

[root@iZuf60c5nb7ulqwzl2jwbsZ .ssh]# ssh -T git@github.com
The authenticity of host 'github.com (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)? yes
Warning: Permanently added 'github.com,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@github.com
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.
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值