Skip to content

Instantly share code, notes, and snippets.

@aparedero
Last active May 31, 2020 21:52
Show Gist options
  • Save aparedero/a1a37fc15b012ce62818417a08fba23c to your computer and use it in GitHub Desktop.
Save aparedero/a1a37fc15b012ce62818417a08fba23c to your computer and use it in GitHub Desktop.
Vagrant Workaround: Permission denied after setting up and environment. Source: https://superuser.com/questions/1296024/windows-ssh-permissions-for-private-key-are-too-open
:: # Set Variable ::
Set Key=".vagrant\machines\default\virtualbox\private_key"
:: # 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%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment