EC2接続時のエラーとその解決方法をメモ
Permissions 0644 for '〜.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 "〜.pem": bad permissions
ec2-user@iPアドレス.リージョン.compute.amazonaws.com: Permission denied (〜).
.pemファイルの権限がゆるいとエラーがでるらしいので、以下のコマンドで解決。
chmod 400 ~.pem
やっていること
一桁目 所有者
二桁目 グループ
三桁目 その他
数字の意味
4 読み取りのみ
2 書き込みのみ
1 実行のみ
0 全て禁止
つまり、400は所有者のみに、読み取り権限を与えている。