LoginSignup
1
3

More than 5 years have passed since last update.

AWSへのSSH接続で困ったこと(Connection timed out)

Last updated at Posted at 2017-05-01

トラブル

AWSへのSSH接続がうまくできなくて困ったので、自分が迷ったときのための解決法をまとめます。

 .>ssh -i "$$$$.pem" ec2-user@ec2-xx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com

とOpenSSH及びPUTTYで入力したところ以下のようなエラーが出ました

ssh: connect to host ec2-xx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com port 22: Connection timed out

原因

結果的には原因が2つ

1. そもそも社用PCを用いたためファイアウォールに弾かれた

2. AWSのEC2のインスタンスのセキュリティグループのホワイトリストに自分のPCのIPアドレスを登録していなかった(よく忘れるというか出先ごとにEC2のマネージメントページから登録するの面倒)

解決策

1. 社外ネットワークから個人PCで接続

2. 毎回ホワイトリストに登録する←すごく面倒なので良い手段を考え中

おまけ

ファイルのアクセス権限周りでエラーが出た場合

.>chmod 400 $$$$.pem

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3