[英]Can't push to github in ssh terminal session (Ubuntu ssh-agent over ssh)
有時我忘記將某些內容推送到家用計算機上的github,因此我使用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存儲庫就是這個庫:git@github.com:skerit / alchemy.git
它也只能在github上使用。 其他私人存儲庫也可以正常工作。
我現在的解決方法是創建一個vnc會話並像這樣推送它,但這很煩人。
編輯1:
Ubuntu的ssh-agent似乎以某種方式綁定到Unity會話,並且從那里沒有產生的任何進程都無法訪問它。 真煩人。
3123 ? Ss 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch gnome-session --session=ubuntu
編輯2:
我找到了一種使用現有ssh-agent的方法,盡管它確實在現有密鑰中加載,但STILL無法正常工作。
https://superuser.com/questions/141044/sharing-the-same-ssh-agent-among-multiple-login-sessions
如果您的“非在家”計算機具有SSH密鑰和正在運行的代理,則可以在連接到家用計算機時使用代理轉發。 嘗試ssh選項-A
或將ForwardAgent
設置為Yes
。 有關更多詳細信息,請參見man ssh
和man ssh_config
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.