17370845950

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

在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.