18
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ssh: connect to host [IPアドレス] port 22: Operation timed out

Posted at

AWSでSSH接続した際のエラーをご紹介します。

MacBook-2:[アプリ名] [ユーザ名]$ ssh -i ~/.ssh/[キー名]_key.pem ec2-user@[IPアドレス]

MacBook-2:[アプリ名] [ユーザ名]$ ssh: connect to host [IPアドレス] port 22: Operation timed out

「EC2」→「セキュリティグループ」→「インバウンド」の編集で下記の通り、追加、保存する。

スクリーンショット 2018-06-01 12.43.10.png

原因はスクールと自宅からそれぞれSSH接続していたため、SSHの設定が2箇所必要でした。

MacBook-2:[アプリ名] [ユーザ名]$ ssh -i ~/.ssh/[キー名]_key.pem ec2-user@[IPアドレス]

Last login: Thu May 31 12:38:49 2018 

       __|  __|_  )
       _|  (     /   Amazon Linux AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-ami/2018.03-release-notes/

再度、ssh接続すれば繋がります。

18
15
3

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
18
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?