So I'm trying to set up an EC2 instance on AWS and I've created a key pair and downloaded the .pem file. However, when I try to open it I get the error message:
I've also read about entering the following in the terminal to work around the issue:
security import pub_key.pem -k ~/Library/Keychains/login.keychain
but this doesn't work either (I get the following error message:
security: Error reading infile pub_key.pem: No such file or directory).
I've also tried just creating new key pairs but the problem persists.
The
.pem
file contains your private key used for establishing anssh
connection with an Amazon EC2 instance (or any Linux instance).Do not open (double-click) the
.pem
file. Instead, you will use it with thessh
command to connect with your instance, eg:See documentation: Connecting to Your Linux Instance Using SSH