パスワードなしの2段階リモートSSH

パスワードなしの2段階リモートSSH

ローカルホストからリモート サーバーに ssh し、そこからリモート コンピューターに ssh したいと思っています。現在、リモート コンピューターとリモート サーバーの間でパスワードなしの ssh がセットアップされるように設定していますが、ローカルホストからサーバーに ssh し、そこからコンピューターに ssh しようとすると、次のエラーが発生します。

Enter passphrase for key '/home/user/.ssh/id_dsa': 
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).

リモート サーバーで開いているターミナルからリモート コンピューターに ssh しようとすると、問題なく動作します。ディスプレイが になっていないことと関係があるのでしょうか:0.0、それともまったく別の何かでしょうか。試してみましたxhost +local:が、それ以上はわかりません。

ありがとう

答え1

両方のシステムにローカル システムの公開キーがある場合は、 を使用します-A

からssh(1)

-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.

その結果、2 番目のホストに対して認証を行うと、その認証は物理的に存在するホストまで転送されることになります。

例:

me@host0:~ $ ssh -A host1
Last login: Thu Jun 14 11:31:53 2012 from 2001:db8::b0
me@host1:~ $ ssh -A host2
Last login: Thu Jun 14 11:41:05 2012 from 2001:db8::b1
me@host3:~ $ ssh -A host3
Last login: Tue Jun 12 10:46:50 2012 from 2001:db8::b2
me@host3:~ $ 

答え2

エージェントはリモート コンピュータに認証を渡すことができません。必要に応じて、接続をポート転送してリモート マシンに直接接続することができます。

見るSSHマルチホップに関するこの記事についてのセクションにスキップしてくださいProxyCommand

~/.ssh/config

Host remotecomputername
  ProxyCommand ssh -q remoteservername nc -q0 remotecomputername 22

関連情報