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 Value | Permission | Plain English |
---|---|---|
7 | 4+2+1 | (read/write/execute) |
6 | 4+2 | (read/write) |
5 | 4+1 | (read/execute) |
4 | 4 | (read) |
3 | 2+1 | (write/execute) |
2 | 2 | (write) |
1 | 1 | (execute) |
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:
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @lokinc! You received a personal award!
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!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit