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
4
4
$sshdpath = Join-Path $scriptdir " sshd.exe"
5
5
$sshagentpath = Join-Path $scriptdir " ssh-agent.exe"
6
6
7
- $ntrights = Join-Path $scriptdir " ntrights.exe -u `" NT SERVICE\SSHD`" +r SeAssignPrimaryTokenPrivilege"
7
+ $ntrights = " ntrights.exe -u `" NT SERVICE\SSHD`" +r SeAssignPrimaryTokenPrivilege"
8
8
9
9
if (-not (Test-Path $sshdpath )) {
10
10
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
27
27
28
28
New-Service - Name sshd - BinaryPathName $sshdpath - Description " SSH Deamon" - StartupType Manual - DependsOn ssh- agent | Out-Null
29
29
sc.exe config sshd obj= " NT SERVICE\SSHD"
30
+
31
+ Push-Location
32
+ cd $scriptdir
30
33
cmd.exe / c $ntrights
34
+ Pop-Location
31
35
Write-Host - ForegroundColor Green " sshd and ssh-agent services successfully installed"
32
36
You can’t perform that action at this time.
0 commit comments