Created
April 15, 2022 22:54
-
-
Save SebastianRiquelmeM/a3cc905ea6bfc3d9a0903ee9c89108b2 to your computer and use it in GitHub Desktop.
How to do chmod400 on windows powershell.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://stackoverflow.com/a/43317244 | |
$path = ".\aws-ec2-key.pem" | |
# Reset to remove explict permissions | |
icacls.exe $path /reset | |
# Give current user explicit read-permission | |
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)" | |
# Disable inheritance and remove inherited permissions | |
icacls.exe $path /inheritance:r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace ".\aws-ec2-key.pem" with the path and name of your .pem file.