Permissions Are Too Open

in linux •  7 years ago 

If you SSH to a Linux machine and encounter the following error:

lyle@lyle-laptop:~/Downloads$ ssh -i key-test.pem [email protected]
Permissions 0640 for 'key-test.pem' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored.

-rw-r----- 1 lyle lyle 1696 Jan 12 14:06 key-test.pem
-rw------- 1 lyle lyle 1771 Jan 23 10:09 key-prod.pem 

Now notice that the permissions for key-test.pem is 640 and the permissions for key-prod.pem is 600

If I was to SSH to a certain box using the key-test.pem it would give me the error above in the first line of this post. If I was to use the key-prod.pem and it is a valid key on that system then it would login without any problems.

To solve this we change the permission of the key file.

lyle@lyle-laptop:~/Downloads$ chmod 600 key-test.pem
Check the permissions

-rw------- 1 lyle lyle 1696 Jan 12 14:06 key-test.pem
-rw------- 1 lyle lyle 1771 Jan 23 10:09 key-prod.pem 

Now you would be able to SSH without any problem.

Just for reference in case you need. A little handy table.

Numeric ValuePermissionPlain English
74+2+1(read/write/execute)
64+2(read/write)
54+1(read/execute)
44(read)
32+1(write/execute)
22(write)
11(execute)
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @lokinc! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:

SteemitBoard knock out by hardfork

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @lokinc! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!