测试 SSH 连接之前,您应已完成以下各项:
测试连接时,您将需要使用密码(即您之前创建的 SSH 密钥密码)验证此操作。 有关使用 SSH 密钥密码的更多信息,请参阅“使用 SSH 密钥密码”。
- 
打开 Terminal(终端)Terminal(终端)Git Bash。 
- 
输入以下内容: $ ssh -T git@主机名 # Attempts to ssh to GitHub Enterprise您可能会看到类似如下的警告: > The authenticity of host '主机名 (IP ADDRESS)' can't be established. > RSA key fingerprint is 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)?或类似如下: > The authenticity of host '主机名 (IP ADDRESS)' can't be established. > RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. > Are you sure you want to continue connecting (yes/no)?
- 
验证您看到的消息中的指纹匹配步骤 2 中的消息之一,然后输入 yes:> Hi username! You've successfully authenticated, but GitHub does not > provide shell access.您可能会看到以下错误消息: ... Agent admitted failure to sign using the key. debug1: No more authentication methods to try. Permission denied (publickey).这是某些 Linux 发行版的已知问题。 更多信息请参阅“错误:代理承认没有签署”。 
- 
验证生成的消息包含您的用户名。 如果收到“权限被拒绝”消息,请参阅“错误:权限被拒绝(公钥)”。