2011-02-16 84 views
1

我已經爲GitHub設置了SSH,供GitHub使用,但是仍有一些錯誤,我的公鑰Permission Denied,我錯過了配置?GitHub:安裝SSH

有人可以幫我嗎?

這裏是ssh -v [email protected]

$ ssh -v [email protected] 
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007 
debug1: Reading configuration data /c/Users/GusDeCooL/.ssh/config 
debug1: Applying options for github.com 
debug1: Connecting to github.com [207.97.227.239] port 22. 
debug1: Connection established. 
debug1: identity file /c/Users/GusDeCooL/.ssh/id_rsa.pub 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 /c/Users/GusDeCooL/.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: Offering public key: /c/Users/GusDeCooL/.ssh/id_rsa.pub 
debug1: Remote: Forced command: gerve gusdecool 
debug1: Remote: Port forwarding disabled. 
debug1: Remote: X11 forwarding disabled. 
debug1: Remote: Agent forwarding disabled. 
debug1: Remote: Pty allocation disabled. 
debug1: Server accepts key: pkalg ssh-rsa blen 277 
debug1: PEM_read_PrivateKey failed 
debug1: read PEM private key done: type <unknown> 
Enter passphrase for key '/c/Users/GusDeCooL/.ssh/id_rsa.pub': 
debug1: No more authentication methods to try. 
Permission denied (publickey). 

副本調試文字請幫助我.. 預先感謝...

+0

你使用的是cygwin還是mingw?如果是的話,你檢查了.ssh目錄的許可證?那通常是問題。 – 2011-02-16 11:40:38

回答

7

默認情況下,出於安全考慮,OpenSSH的拒絕你的要求使用專用如果您沒有爲密鑰文件設置權限,則該密鑰爲600(用戶名r + w,否認爲休息)。

從Git bash運行chmod 600 ~/.ssh/id_rsa*,假設您安裝了​​。

如果不是這樣,那麼您很可能沒有按照創建密鑰對和將公鑰導入GitHub的步驟進行操作。您可能想重新採取那些更加註意的步驟(Generating & Troubleshooting)。