目次(随時追加)
当該SubnetのRouteTableに当該InternetGatewayが追加されていない: Operation timed out
問題
原因
解決
- EC2インスタンス一覧
- 当該インスタンスの
Subnet ID
をメモる - VPC→Subnets→当該Subnetの
Route Table
のリンクをクリックしてRoute Table設定へ行く - 当該RouteTableの
Routes
でEdit - (便宜上とりあえず)Destinationを
0.0.0.0/0
として当該VPCにattachされているInternetGatewayを追加
ダウンロードしたKeyPairファイル(.pem)のアクセス権限: Permission denied (publickey).
問題
- sshがネットワーク的に到達しているが以下のようなエラーが出る
% ssh -i /tmp/my-project.pem ec2-user@X.X.X.X Permissions 0644 for '/tmp/my-project.pem' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "/tmp/my-project.pem": bad permissions Permission denied (publickey).
原因
- 最後の一文だけ見て焦るけど、おちついて全文読みましょう
- pemファイルのファイルアクセス権限の問題なので、
chmod
の話
解決
% chmod 600 /tmp/my-project.pem
ローカルのデフォルトユーザでsshを試みている: Permission denied (publickey).
問題
Host my-test HostName 123.123.123.123 IdentityFile ~/.ssh/tmp/my-test.pem
として、sshを試みるも、
% ssh my-test Permission denied (publickey).
となる。
原因
- 自動生成されるidentityは、
ec2-user
名義のpemであるので、User
を指定する必要がある。
解決
% ssh ec2-user@my-test
あるいは、~/.ssh/config
において、
Host my-test
HostName 123.123.123.123
+ User ec2-user
IdentityFile ~/.ssh/tmp/my-test.pem
とする。
雑感
- 何事も、慣れだ
Amazon Web Services実践入門 (WEB+DB PRESS plus)
- 作者: 舘岡守,今井智明,永淵恭子,間瀬哲也,三浦悟,柳瀬任章
- 出版社/メーカー: 技術評論社
- 発売日: 2015/11/10
- メディア: 単行本(ソフトカバー)
- この商品を含むブログ (1件) を見る