SSHエージェント配信、マルチホップ

SSHエージェント配信、マルチホップ

私はLinuxの元のコンピュータを使ってこの設定をテストしました。すべてが同じです。最初のホップだけが元のコンピュータのキーを使用できます。

元の質問

マルチホップを使用してSSHエージェント配信を設定しようとしています。私のローカルコンピュータはパテと美人コンテストがインストールされているWindowsで、すべてのLinuxコンピュータはDebian 7です。

問題は、私の秘密鍵がWindowsで開始され、最初のホップでのみ有効であることです。最初のマシンに追加された秘密鍵はどこでも使用できます。

最初のホップシステムは「vpn1」と呼ばれ、2番目のホップシステムは「www1」と呼ばれます。 「vpn1」はインターネットとイントラネット(10.1.0.1)に接続されています。 「www1」はイントラネット(10.1.0.10)にのみ接続されます。 「vpn1」追加キー([Eメール保護])「ssh-add」を使用すると、このキーが美人コンテストに表示されます。

デバッグ

次の位置に3つのキーをすべて表示できますssh-add -L

ssh-rsa [pubkey-1] [email protected] //This is github key originating from Windows
ssh-rsa [pubkey-2] [email protected] //This is SSH key originating from Windows
ssh-rsa [pubkey-3] [email protected] //This is SSH key originating from 'vpn1'

「vpn1」からダウンロードしようとするとssh -v -T [email protected]

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: [email protected]
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).

「www1」から始めようとするとssh -v -T [email protected]

debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: /home/enbyted/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/enbyted/.ssh/id_dsa
debug1: Trying private key: /home/enbyted/.ssh/id_ecdsa
debug1: Next authentication method: password

'のみ許可するホストのSSHにも同じことが当てはまります。[Eメール保護]'キー。しかし、SSHを使って好きなだけホップを作成できます。[Eメール保護]'。もちろんgitコマンドも同様です。

構成

鉱山~/.ssh/config(すべてのサーバーで同じ):

Host 10.1.0.*
    ForwardAgent yes

Host *
    ForwardAgent no

私のもの/etc/ssh/sshd_config(コメントなし、すべてのサーバーで同じ):

Port <custom-port>
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes

質問

  • では、なぜこのようなのでしょうか?
  • 私は何が間違っていましたか?

また、「www1」では、githubが2つの認証方法、つまりパスワードと公開鍵を提供することが奇妙です...確信しています。

アップデート#1:画像のネットワーク設定

この画像のソースは参考にしてください記事しかし、私の設定はほとんど表示されます。

           ネットワーク設定イメージ

そのため、自宅のコンピュータに2つのキーがあり、ルアフェフ(vpn1)に1つあります。

私の家のPCからルアペフにSSHで接続すると、3つのキーすべてをうまく使用できます。ただし、ruapehu(vpn1)からaoraki(www1)にsshを再度実行すると、ruapehuのキーのみを使用できます。

aoraki(www1)から以下のホストの1つにSSHを接続すると、ホップ数に関係なくruapehuのキーのみが機能します。

ホームPCがPutty + pageantを使用するWindows、またはssh-agentを使用するLinuxの場合はそうではありません。

ベストアンサー1

あなたの問題はPuTTY構成にあると思います。この転送設定は次のように確認する必要があります。

                     SS会話

引用する

おすすめ記事