🐙
AWSのEC2インスタンスにsshで接続するとkex_exchange_identificationのエラー
エラー内容
以下のコマンドでエラーが発生した。
ssh ProductionBastion
kex_exchange_identification: read: Operation timed out
banner exchange: Connection to XXX.XXX.XXX.XXX port 22: Operation timed out
環境
こんな感じのEC2の踏み台サーバーが~/.ssh/configに書かれている。
Host ProductionBastion
# BastionインスタンスのPublic IPv4 address
HostName XXX.XXX.XXX.XXX
Port 22
User ec2-user
IdentityFile ~/.ssh/key-xxx.pem
解決策
EC2のセキュリティーグループのインバウンドルールに正しくIPアドレスが追加されているか確認したが問題なかった。
macのWiFiをOFFにしてからONにしたら直った!
Discussion