windows bad permission for ec2 key

ec2 key bad permission

Yes, again Windows Entertainment. This process of setting permission of ec2 key is pretty simple on Linux but it is not that straightforward on Windows.

if we want to perform SSH to the ec2 instance from a Windows machine using the key, then it checks the permission of the key and if it is accessible to any other user apart from the system, administrator, and logged-in user it gives below error.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'private-key.ppk' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "private-key.ppk": bad permissions

key could be a *.ppk or *.pem

perform the below steps to set appropriate permission.

  1. right click on the key file
  2. select security tab
  3. click Advanced button
  4. click the Disable Inheritance button and then select the recommended option to remove the inherited access
  5. select the unwanted user from list of users and remove other users apart from above mentioned users.
  6. click on the Add button in the advanced security section
  7. select a principal
  8. Enter your Windows user name in “Enter the object name to select”
  9. click ok
  10. click ok
  11. click Apply
  12. click Apply

if you are still facing any issues or have any suggestion then comment and we can have interaction

Tejbahadur Singh

Always learner enthusiast finding solutions of technical issues that exist. Web, Blockchain, cybersecurity, web/app security researcher. I am a nerd who can be found reading books, consuming online contents and reading on internet.

Leave a Reply

Your email address will not be published. Required fields are marked *