Archive | July, 2013

Permission Error PEM File while doing ssh at Amazon EC2

26 Jul

If you are getting error like this

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0444 for '/Users/amazon.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /Users/amazon.pem
Permission denied (publickey).

then you need to do is this:

chmod 400 mykey.pem

Taken from Amazon’s instructions –

Your key file must not be publicly viewable for SSH to work. Use this command if needed: chmod 400 mykey.pem