File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ $scriptdir = Split-Path $scriptpath
44$sshdpath = Join-Path $scriptdir " sshd.exe"
55$sshagentpath = Join-Path $scriptdir " ssh-agent.exe"
66
7- $ntrights = Join-Path $scriptdir " ntrights.exe -u `" NT SERVICE\SSHD`" +r SeAssignPrimaryTokenPrivilege"
7+ $ntrights = " ntrights.exe -u `" NT SERVICE\SSHD`" +r SeAssignPrimaryTokenPrivilege"
88
99if (-not (Test-Path $sshdpath )) {
1010 throw " sshd.exe is not present in script path"
@@ -27,6 +27,10 @@ cmd.exe /c 'sc.exe sdset ssh-agent D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPW
2727
2828New-Service - Name sshd - BinaryPathName $sshdpath - Description " SSH Deamon" - StartupType Manual - DependsOn ssh- agent | Out-Null
2929sc.exe config sshd obj= " NT SERVICE\SSHD"
30+
31+ Push-Location
32+ cd $scriptdir
3033cmd.exe / c $ntrights
34+ Pop-Location
3135Write-Host - ForegroundColor Green " sshd and ssh-agent services successfully installed"
3236
You can’t perform that action at this time.
0 commit comments