【发布时间】:2014-11-04 21:43:50
【问题描述】:
我昨天发布了这个,但我已经取得了一些进展。原来我的IP地址被服务器列入黑名单。不过我还是遇到了一些麻烦。
当我运行“ssh -vvv git@gitlab.cs.myschool.edu”时,我得到了这个:
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /.ssh/id_rsa
debug3: no such identity: /.ssh/id_rsa: No such file or directory
debug1: Trying private key: /.ssh/id_dsa
debug3: no such identity: /.ssh/id_dsa: No such file or directory
debug1: Trying private key: /.ssh/id_ecdsa
debug3: no such identity: /.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /.ssh/id_ed25519
debug3: no such identity: /.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
(这只是一个sn-p,似乎是问题的根源。整个日志在这里:http://pastebin.com/Ryx4NFwW)
是说 /.ssh/id_rsa 不存在,但是:
PS C:\Users\Jonathan\.ssh> ls
Directory: C:\Users\Jonathan\.ssh
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 9/10/2014 10:58 PM 67 config
-a--- 7/5/2014 10:39 PM 1675 github_rsa
-a--- 7/5/2014 10:39 PM 402 github_rsa.pub
-a--- 9/10/2014 11:14 PM 1679 id_rsa
-a--- 9/10/2014 11:14 PM 397 id_rsa.pub
-a--- 9/10/2014 10:17 PM 193 known_hosts
有人有什么想法吗?
编辑:我应该注意,如果我执行“ssh -vvv -i C:\Users\Jonathan.ssh\id_rsa git@gitlab.cs.myschool.edu”,它似乎可以正常工作。
Edit2:我刚刚注意到一些更奇怪的东西。在我上面发布的完整日志中,有这个部分:
debug3: load_hostkeys: loading entries for host "gitlab.cs.myschool.edu" from file "/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "137.30.120.92" from file "/.ssh/known_hosts"
debug3: load_hostkeys: found key type ECDSA in file /.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'gitlab.cs.uno.edu' is known and matches the ECDSA host key.
debug1: Found key in /.ssh/known_hosts:1
debug1: ssh_ecdsa_verify: signature correct
它可以从 known_hosts 文件中查找和读取。它与我的 id_rsa 密钥文件位于同一目录中。这真的很令人困惑,没有任何意义:(
编辑 3:我还尝试在 C:\Users\Jonathan.ssh\config 中创建一个配置文件(之前没有)并将其放入其中:
Host gitlab.cs.uno.edu
IdentityFile C:\Users\Jonathan\.ssh\id_rsa
还尝试将主机更改为 uno.edu,但仍然不行。当我尝试运行 git clone 时,访问被拒绝。
【问题讨论】:
-
Windows 绝对不是我的东西,但是为什么 ssh 调试输出指向
/.ssh/whatever而不是C:/Users/Jonathan/.ssh/whatever? -
我不知道!这是我试图弄清楚的一部分。 SSH 似乎找错地方了,我不知道为什么。
-
能否也显示“.ssh/config”文件的内容?
-
配置文件看起来不错。你用来访问服务器的终端是什么,
command prompt、putty、cygwin、git bash (actually mingw32)或者别的什么?形成日志,似乎是command prompt。您可以尝试使用git bash,它将在您配置的文件夹中查找私钥。