0

我正在尝试使用 ForwardingAgent 从他们的服务器将更改推送到客户端 github 帐户,但我的 id_rsa_corevm 身份没有被转发。

在我的 ~/.ssh/config 文件中,我有这个

Host corevm
        Hostname 192.168.56.101
        User user1
        IdentityFile ~/.ssh/id_rsa_corevm
        ForwardAgent yes

macbook-pro:.ssh macuser$ ssh-add -l
######## /Users/macuser/.ssh/id_rsa (RSA)
######## /Users/macuser/.ssh/id_rsa_corevm (RSA)

当我 ssh 进入他们的服务器并测试与 github 的 ssh 连接时,我看到了我的 id_rsa_corevm 身份,但仍然无法连接到客户端的 github 帐户。

[user1@corevm ~]$ ssh -t -vv git@github.com

debug2: key: /Users/macuser/.ssh/id_rsa (#####)
debug2: key: /Users/macuser/.ssh/id_rsa_corevm (######)

我只看到一个“提供公钥”,而不是我的 id_rsa_corevm。

debug1: Offering public key: /Users/macuser/.ssh/id_rsa

Hi githubuser! You've successfully authenticated, but GitHub does not provide shell access.

成功消息意味着我的默认 id_rsa 文件正在被转发,我可以连接到我自己的 github 帐户。

然后我尝试将更改推送到客户端 github,但我的权限被拒绝。

[user1@corevm test]$ git push origin master
ERROR: Permission to clientgithubuser/test.git denied to githubuser.
fatal: The remote end hung up unexpectedly

我宁愿将我的 id_rsa.pub 添加到我的客户 github 帐户中,但显然 github 不允许共享密钥。

有任何想法吗?

4

0 回答 0