If you received an error when login to AWS EC2 instance or any virtual machine using the PEM file by SSH command like below,
ssh -i ~/.ssh/your_pem_file.pem username@192.168.0.102
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/home/username/.ssh/your_pem_file.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 "/home/username/.ssh/your_pem_file.pem: bad permissions
bitnami@3.6.121.245: Permission denied (publickey).
You can easily find the solutions from the above error, that is "Permissions 0644 for '/home/username/.ssh/your_pem_file.pem:' are too open"
So you need to set the file permission to 600
chmod 600 /home/username/.ssh/your_pem_file.pem
You can try it now and then you are able to log in to an instance by SSH command.
Comments (0)