使用已有的私钥进行GitHub验证_技术学院_宜昌市隼壹珍商贸有限公司

您好,欢迎访问宜昌市隼壹珍商贸有限公司

400 890 5375
当前位置: 主页 > 新闻动态 > 技术学院

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

发布时间:2025-10-01  |  点击率:

在windows上使用已生成的linux ssh密钥对连接github仓库的过程如下:

首先,将生成的私钥存储到Windows上的一个文件夹中,然后通过Git Bash进行操作:

接下来,将私钥文件移动到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.

全国统一服务电话

400 890 5375

电子邮箱:879577@qq.com

公司地址:宜昌市西陵区黄河路5号三峡明珠10栋1051室

咨询微信

TEL:13680874598