使用已有的私钥进行GitHub验证

之前在Linux中已经生成了ssh密钥对,并且也配置好了与GitHub仓库的连接,然后想在windows上也连接一下GitHub仓库,于是把生成好的私钥先存储到windows上的一个文件夹中,接着打开git bash:
使用已有的私钥进行GitHub验证

然后把私钥文件移动到git的ssh目录下:

$ mv E:/git_ssh_key/id_rsa ~/.ssh
$ ls ~/.ssh
id_rsa  known_hosts

接着就可以直接进行身份验证了:

$ ssh -T git@github.com
The authenticity of host 'github.com (192.30.255.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
Enter passphrase for key '/c/Users/admin/.ssh/id_rsa':     # 你私钥的密码

# 末尾显示这一段表示验证成功
Hi Binary-ZeroOne! You've successfully authenticated, but GitHub does not provide shell access.

转载于:https://blog.51cto.com/zero01/2060828

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值