2013-10-14 86 views
1

我遇到了此權限被拒絕的問題。 我知道很多這樣的帖子存在和相信我,我已經嘗試過所有這些。我已經修改了文件權限600,我已經更新我的配置文件到以下幾點:與GITHUB的SSH身份驗證問題(權限被拒絕)

Host gh 
     Hostname github.com 
     User git 
     IdentityFile ~/.ssh/id_rsa 
     ForwardAgent yes 

日誌是:

$ ssh -vT [email protected] 
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007 
debug1: Reading configuration data /c/Users/marker/.ssh/config 
debug1: Connecting to github.com [192.30.252.130] port 22. 
debug1: Connection established. 
debug1: identity file /c/Users/marker/.ssh/identity type -1 
debug1: identity file /c/Users/marker/.ssh/id_rsa type 1 
debug1: identity file /c/Users/marker/.ssh/id_dsa type 2 
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debia 
n-5ubuntu1+github5 
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1+github5 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/marker/.ssh/known_hosts:2 
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/marker/.ssh/id_rsa 
debug1: Authentications that can continue: publickey 
debug1: Offering public key: /c/Users/marker/.ssh/id_dsa 
debug1: Authentications that can continue: publickey 
debug1: Trying private key: /c/Users/marker/.ssh/identity 
debug1: No more authentication methods to try. 
Permission denied (publickey). 

的Telnet似乎是工作的罰款和我的ssh-agent返回

$ ssh-agent 
SSH_AUTH_SOCK=/tmp/ssh-FjgkeW2344/agent.2344; export SSH_AUTH_SOCK; 
SSH_AGENT_PID=6020; export SSH_AGENT_PID; 
echo Agent pid 6020; 

我似乎無法理解問題是什麼,如果任何人都可以幫助,那是表示讚賞! 我使用Windows 7和msysgit。

+0

鑑於日誌清楚地表明,私有密鑰加載,讓我問一個問題,剛纔是非常安全的:你加的公鑰確切的私人密鑰到你的GitHub賬戶? – poke

+0

是的,我很確定我做到了。我使用了剪輯命令來複制密鑰。我不認爲它可能出現錯誤... – BudsNanKis

+0

它看起來好像你沒有將公鑰添加到你的git hub帳戶。轉到〜/ .ssh,只需用文本編輯器打開公鑰,然後將其複製到github中。 –

回答

0

我寧願指定的完整路徑id_rsa專用密鑰:

IdentityFile /full/path/.ssh/id_rsa 

如果你有id_rsa.pub,如果每個父目錄是properly protected(無法寫入「組」),然後雙擊檢查您在Github配置文件中複製的密鑰。

或者再試一次,用密鑰而不是受密碼保護(意思是不需要ssh-agent),只是爲了驗證這是否可行。

0

可能是你可以這樣做:

ssh -vT gh 
+1

您能否詳細說明您的答案,以便OP能夠詳細瞭解您建議的選項,以及它們可能如何提供幫助? – Castaglia