Permissions are too open // #AWS keypair issue - Windows
What does keypair mean in AWS compute ?
Generally a key pair, consisting of a public key and a private key, is a set of security credentials that you use to prove your identity when connecting to an Amazon EC2 instance. Amazon EC2 stores the public key on your instance, and you store the private key.
For Unix based instances, the private key allows you to securely SSH into your instance.
In Windows, there are permission errors while accessing cloud ec2 instances or any aws service.
ERROR-1
Permission denied (publickey)
ERROR-2
Permissions for 'c:\\Users\\$username\\Downloads\\keypair.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Solution:
- Move keypair.pem to C:/users/username/.aws/kepair.pem
- Install/open gitbash or cygwin or visual-studio terminal
- change permissions of file using chmod 400 C:/users/username/.aws/kepair.pem
- If it still cant be accessed run chmod 600 C:/users/username/.aws/keypair.pem
- Now run ssh -i "c:\Users\username\.aws\keypair.pem" ec2-user@serverIP
Comments
Post a Comment
feel free to give feedback