リモートコンピュータからgithubにSSH経由で接続できませんどうすればいいですか?

リモートコンピュータからgithubにSSH経由で接続できませんどうすればいいですか?

SSH経由でリモートサーバーに接続しています。私はリモートサーバーからgithubにSSH経由でアクセスできるようにしたいです。

私は他の人がそのコンピュータにアクセスできるリモートサーバーに私の秘密鍵を保存したくありません。

リモートサーバーからgithubにsshしようとすると、次のエラーが発生します。https://stackoverflow.com/questions/24961682/github-permission-denied-message-even-though-key-has-been- added

私のローカルコンピュータに以下を設定しましたが、~/.ssh/config役に立ちません。

Host remoteHost
    ForwardAgent yes

リモートコンピュータに新しいキーペアを設定してgithubに追加できますか?または、ローカルコンピュータからリモートコンピュータにSSHを接続する機能は中断されますか?

ベストアンサー1

気に入らない場合は、SSHキーをコピーする必要はありません。 -A を使用してローカルキーを渡すことができます。

 -A      Enables forwarding of the authentication agent connection.  This can also be specified on a per-host basis in a configuration file.

         Agent forwarding should be enabled with caution.  Users with the ability to bypass file permissions on the remote host (for the agent's UNIX-domain socket) can access the local agent through
         the forwarded connection.  An attacker cannot obtain key material from the agent, however they can perform operations on the keys that enable them to authenticate using the identities loaded
         into the agent.

私はこのように使いますが、

ssh -At user@server

あるいは、時にはこれを実行するために別のホストにジャンプする必要があるかもしれません。

ssh -At user@server -- ssh -At user2@server2

おすすめ記事