2013-08-21 60 views
0

有时候我忘了在家里的电脑上推送一些东西给github,所以我很快用SSH登录到它然后推送它。但我总是得到这个错误:无法推送到SSH终端会话中的github(通过SSH的Ubuntu ssh代理)

$ git push 
Permission denied (publickey). 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

我有X11转发打开,但就是这样!为什么当我在家时它只是在工作而抱怨公钥?

GitHub的库就是这样一个: [email protected]:skerit/alchemy.git

它也只失败,GitHub的工作。其他,私人存储库工作得很好。

我现在的解决方法是创建一个vnc会话,并像这样推送它,但这很烦人。

EDIT1:

Ubuntu的SSH代理似乎以某种方式结合到统一的会话,任何过程不是从那里出来就出来不能访问它。这很烦人。

3123 ?  Ss  0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch gnome-session --session=ubuntu 

EDIT2:

我找到了一种方法使用现有的ssh-agent,虽然它在现有密钥加载,它仍然无法正常工作。

https://superuser.com/questions/141044/sharing-the-same-ssh-agent-among-multiple-login-sessions

回答

0

如果你的“不在家”机器有你的SSH密钥并运行连接到自己家里的电脑时,你可以使用代理转发代理。尝试使用ssh选项-A或将ForwardAgent设置为Yes。进一步的细节见man sshman ssh_config