Skip to content

Instantly share code, notes, and snippets.

@Scot-Bernard
Scot-Bernard / ssh-pm-win.ps1
Last active January 29, 2023 15:22
Set ssh private key permissions on Windows
# To avoid permissions problems, run this on Windows PowerShell, Core edition doesn't have SetAccessControl implemented at base level.
# A variant for it is welcome.
# Allow the powershell session to run this script with:
# Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
function Set-SshPermissions {
param (
$pkFile
)