pem file is too open code example

Example 1: Load key ".pem": bad permissions

chmod 400 ~/.ssh/mykeyfile.pem

Example 2: pem key permissions too open

chmod 400 mykey.pem

Example 3: pem file is too open

:: # Set Variable:
   Cmd /c Set Key="C:\Path\to\keyfile"

:: # Remove Inheritance:
   Cmd /c Icacls %Key% /c /t /Inheritance:d

:: # Set Ownership to Owner:
   Cmd /c Icacls %Key% /c /t /Grant %UserName%:F

:: # Remove All Users, except for Owner:
   Cmd /c Icacls %Key% /c /t /Remove Administrator "Authenticated Users" BUILTIN\Administrators BUILTIN Everyone System Users

:: # Verify:
   Cmd /c Icacls %Key%

Tags:

Misc Example