Skip to content

Instantly share code, notes, and snippets.

@rjmii
Forked from jaskiratr/chmod-400.cmd
Last active May 17, 2020 16:38
Show Gist options
  • Save rjmii/bd7c3f5861196fdd0db1a05c2dd1a79c to your computer and use it in GitHub Desktop.
Save rjmii/bd7c3f5861196fdd0db1a05c2dd1a79c to your computer and use it in GitHub Desktop.
Set permission of file equivalent to chmod 400 on Windows.
$path = ".\.vagrant\machines\default\hyperv\private_key"
icacls.exe $path /reset
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
icacls.exe $path /inheritance:r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment