2014-09-23 101 views
15

我碰到下面的錯誤,而我試圖把我的代碼使用到GitHub上Sourcetree發現:錯誤(internetKeychainItemForServer:withUsername:路徑:端口:協議:) - 指定的項目不能在鑰匙串

Pushing to http://github.myOrg.com/my-repo/my-proj.git 
2014-09-23 13:05:20.500 git-credential-sourcetree[6744:507] Error (internetKeychainItemForServer:withUsername:path:port:protocol:) - The specified item could not be found in the keychain. 
remote: Permission to ion-my-repo/my-proj.git denied to my-user-id. 
fatal: unable to access 'http://github.myOrg.com/my-repo/my-proj.git/': The requested URL returned error: 403 

當我打推,sourcetree問我要我的密碼我的帳戶相關:

Password required 
For user my-user-id on host github.myOrg.com 

所以看起來sourcetree知道什麼是我的用戶ID,它只是需要訪問我的github帳戶的密碼。我能夠使用sourcetree提取內容,並且不會向我索取我的憑據。我也能夠推動這個項目,但最近我的系統管理員在我的Mac上用鑰匙鏈做了一些事情,從那時起我無法在github上推送任何東西。

以前有沒有人遇到過這個問題?

+0

我手動將證書添加到鑰匙串,這似乎工作。 – 2014-09-24 15:36:40

+0

你能告訴我們嗎? – 2014-10-22 07:21:51

+0

在鑰匙串中:在'密碼'類別中添加'bitbucket.org'項。 – 2014-11-06 12:25:33

回答

14

我有完全相同的問題。看起來,代理不知何故失去了我的憑據。我意識到,當我試圖使用terminal列出我所有的SSH密鑰:

$ ssh-add -l 
> The agent has no identities. 

於是我就

$ ssh-add ~/.ssh/my_rsa_key 

我輸入密碼我的鑰匙。問題就消失了。

所以,我不知道爲什麼我的ssh代理突然失去了它的密鑰,但如果這是你遇到的同樣的問題,你可以通過使用ssh-add命令添加ssh密鑰來解決。

這可能是有許多不同原因和解決方案的問題之一,我只是爲我的案例提出一個解決方案。

+0

這對我有用!奇怪的是,如果我打開「鑰匙串訪問」並搜索「ssh」,我可以在那裏看到鑰匙。它實際上是沒有它的ssh代理。 – GabrielOshiro 2016-04-11 03:30:39

相關問題