0

I'm trying to SSH the ec2-instance with my terminal where I'm using SSH to connect with the instance but I'm unable to do so. I'm getting the below error,

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'xxjsxxxx.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 "xxjsxxxx.pem": bad permissions
ecinstance@ec2-22-1xx-1x6-xx7.compute-1.amazonaws.com: Permission denied (publickey).

NOTE: I had obscured the IP address and file name for privacy reasons. That said, can someone help me with this?

Steps that I went through before raising this concern, I had checked the logs and other StackOverflow articles with respect to RSA key-pair value used to SSH but no luck.

Looking forward. Good day!

somesh
  • 21
  • 1
  • 7
  • It tells you what the problem is: The file permission is too open. This can be fixed using `chmod` (see answer in the duplicate question). – Daniel W. Jan 24 '22 at 12:29
  • Hi Daniel, I checked the question that you shared it is of partial help but however, I found the exact answer to the question. It's by using port 600(Read and Write) and 400(Read only). I used `chmod 600 xxjsxxxx.pem` in the terminal and it worked like a piece of cake. Post which, I tried following the SSH command, things fell in line. Thanks much, Daniel. – somesh Jan 24 '22 at 12:41
  • 1
    No problem! Glad it worked. 400 is not a port, its the [octal representation of filesystem permissions](https://docs.oracle.com/cd/E19504-01/802-5750/6i9g464pv/index.html). – Daniel W. Jan 24 '22 at 12:52

0 Answers0