web-dev-qa-db-ja.com

踏み台インスタンスを使用したSSH-stdio転送に失敗しました

AWSに要塞ホストを設定しています(詳細はこちら-- https://www.nadeau.tv/ssh-with-a-bastion-Host/ )。 AWSにある他のEC2インスタンス。

要塞ホストを介してプロキシしようとすると、いくつかの問題が発生します。

私のSSH構成ファイルは次のとおりです。

# Bastion Host
Host bastion
User ec2-user
Hostname XX.XX.XX.XXX
IdentityFile ~/.ssh/keys/bastion.pem

# EC2 Instance
Host 172.*
User ec2-user
IdentityFile ~/.ssh/keys/bastion.pem
ProxyCommand ssh bastion -W %h:%p

以下はコマンドラインからの詳細な出力です:

Jeff-Bezos-iMac:tmp jeff$ ssh 172.xx.x.xx -v
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/jeff/.ssh/config
debug1: /Users/jeff/.ssh/config line 9: Applying options for 172.*
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Executing proxy command: exec ssh bastion -W 172.xx.x.xx:22
debug1: key_load_public: No such file or directory
debug1: identity file /Users/jeff/.ssh/keys/bastion.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/jeff/.ssh/keys/bastion.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: permanently_drop_suid: 503
channel 0: open failed: connect failed: Connection timed out
stdio forwarding failed
ssh_exchange_identification: Connection closed by remote Host

「stdio転送に失敗しました」というエラーが発生しました。

よろしく

3
Stephen

SSHセキュリティグループを正しく構成していませんでした。BastionServerのプライベートIPからの受信SSHリクエストを受け入れるように変更されたとき、すべてが期待どおりに機能しました。

2
Stephen