首先,我應該說我運行Windows 7的Git:不能拉
所以,我想從我的回購在今天上午早些時候拉像我平時做的,我是不能夠。我得到的錯誤:
The authenticity of host 'github.com (207.97.227.239)' 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)? yes
Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of know
n hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
對此,git's documentation說:
現在,我不完全知道如何因爲我訪問在Windows中的〜/ .ssh文件夾(可在網上找到任何東西),所以我試着運行ssh-keygen,然後按回車。那雖然不起作用。
C:\Users\Ceasar\Desktop\lemonwi.se\lw_reviews\src>ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (//.ssh/id_rsa):
Could not create directory '//.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
open //.ssh/id_rsa failed: No such host or network path.
Saving the key failed: //.ssh/id_rsa.
在這一點上,我試圖尋找錯誤,但找不到任何運氣。
任何人都可以幫助我恢復我從再次回購的能力嗎?
我懷疑它可能是一個PATH變量的問題,因爲我幾天前意外刪除了它們,只是恢復了我能記住的內容,但我不確定這裏發生了什麼。
編輯:使用Git Bash,我導航到./ssh並創建了一個新的密鑰。
[email protected] ~ (master)
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Ceasar/.ssh/id_rsa):
/c/Users/Ceasar/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Ceasar/.ssh/id_rsa.
Your public key has been saved in /c/Users/Ceasar/.ssh/id_rsa.pub.
The key fingerprint is:
10:b5:03:59:ec:02:18:fd:90:3c:69:1e:02:a4:93:2d [email protected]
我然後複製它交給https://github.com/account/ssh,但我依然收到錯誤:
C:\Users\Ceasar\Desktop>git pull origin master
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
運行SSH -vT [email protected]給我:
C:\Users\Ceasar\Desktop>ssh -vT [email protected]
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file /.ssh/identity type -1
debug1: identity file /.ssh/id_rsa type -1
debug1: identity file /.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debia
n-5github2
debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /.ssh/identity
debug1: Trying private key: /.ssh/id_rsa
debug1: Trying private key: /.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
編輯2:所以使用Git Bash,我可以成功取出,這意味着這與Windows不知道主目錄的位置有關。 Windows沒有顯式地有一個家庭變量,雖然根據這個:http://en.wikipedia.org/wiki/Environment_variable#Default_Values_on_Microsoft_Windows,所以我仍然有點困惑。
'〜/ .ssh'是不一樣的'/ .ssh' – titaniumdecoy
打開你的Git bash和鍵入'回聲$ HOME'。在我的盒子(也運行Win7的),我得到了我'%USERPROFILE%'路徑而這也正是我的'.ssh'文件夾。 – eckes