本人是在 win10 系统下使用在 https://git-scm.com/download/win 下载的 git 命令行。 在使用 ssh -vT git@github.com 后,输出如下:
$ ssh git@github.com -vT
OpenSSH_7.1p2, OpenSSL 1.0.2h 3 May 2016
debug1: Reading configuration data /c/Users/DaCong/.ssh/config
debug1: /c/Users/DaCong/.ssh/config line 1: Applying options for github.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to ssh.github.com [182.239.95.136] port 443.
debug1: Connection established.
debug1: identity file /c/Users/DaCong/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/DaCong/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/DaCong/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/DaCong/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/DaCong/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/DaCong/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/DaCong/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/DaCong/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
ssh_exchange_identification: Connection closed by remote host
从 debug 的结果来看,应该是没有找到 key 文件,可是,我在 ~/.ssh/ 下执行 ls -la 之后,输出如下:
total 34
drwxr-xr-x 1 DaCong 197609 0 7 月 5 09:47 ./
drwxr-xr-x 1 DaCong 197609 0 7 月 5 23:10 ../
-rw-r--r-- 1 DaCong 197609 53 7 月 5 08:43 config
-rw-r--r-- 1 DaCong 197609 1679 7 月 5 09:19 id_rsa
-rw-r--r-- 1 DaCong 197609 392 7 月 5 09:19 id_rsa.pub
应该说我是有密钥文件的,而且也有读写权限,为什么就成了找不到 key 了呢? 因为这个问题,我提交文件的时候用的是 https , clone 也是,每次更新 hexo 博客都要输入密码,非常麻烦。 还有,我已经在 github 中提交了 id_rsa.pub 。 我已经在 google 上搜索过了,相似的问题的解决方案并没有起作用,所以来 V2EX 提问,希望能够解决问题。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.