Using GitHub Deploy Keys to Update Module for Automation
- Generate SSH key
- Copy to server (e.g. C:.ssh)
-
Ensure ssh-agent is set Automatic (Delayed Start)
Get-Service ssh-agent | Select-Object -Property StartType StartType --------- Disabled
Get-Service ssh-agent | Set-Service -StartupType Automatic
Get-Service ssh-agent Status Name DisplayName ------ ---- ----------- Running ssh-agent OpenSSH Authentication Agent
-
Set ACL’s on the ssh key directory
$acl = get-acl .\.ssh\ $accessrule = new-object System.Security.AccessControl.FileSystemAccessRule("BUILTIN\Administrators","FullControl", "ContainerInherit,ObjectInherit", "None", "Allow") $acl.SetAccessRuleProtection($true, $false) Set-Acl .\.ssh\ $acl
-
Add the ssh key (you’ll need the passphrase you set up earlier)
ssh-add {path to key}
-
Install Git
- If you’re using a headless system chocolatey can help keep chocolatey up to date until winget is supported on server operating systems.
-
Ensure your key still exists (just in case)
ssh-add -l
Comments