0

After I created an ec2 instance, I tried to ssh into the port by using the private key, but even though I chmod the key down to 400, I get this error.

vagrant@ubuntu-bionic:/vagrant$ chmod 400 ./itmo-544-2019.pem
vagrant@ubuntu-bionic:/vagrant$ ssh -i ./itmo-544-2019.pem ubuntu@<ip-address>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0555 for './itmo-544-2019.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 "./itmo-544-2019.pem": bad permissions
ubuntu@18.205.191.197: Permission denied (publickey).

I made sure the private key starts with

-----BEGIN RSA PRIVATE KEY-----

and ends with

-----END RSA PRIVATE KEY-----

I also tried chmod 600 ./itmo-544-2019.pem. But this didn't help either.

Any idea why?

  • Try chmod 700 . so the directory containing your private key is protected. Also check the owner of your private key file and the directory containing your private key (/vagrant/). Please post output of ls -al . – FedonKadifeli Oct 16 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.