Skip to content

Commit 4f87e35

Browse files
committed
updated install script to accomodate spaces in directory paths
1 parent 26be931 commit 4f87e35

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contrib/win32/openssh/install-sshd.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

99
if (-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

2828
New-Service -Name sshd -BinaryPathName $sshdpath -Description "SSH Deamon" -StartupType Manual -DependsOn ssh-agent | Out-Null
2929
sc.exe config sshd obj= "NT SERVICE\SSHD"
30+
31+
Push-Location
32+
cd $scriptdir
3033
cmd.exe /c $ntrights
34+
Pop-Location
3135
Write-Host -ForegroundColor Green "sshd and ssh-agent services successfully installed"
3236

0 commit comments

Comments
 (0)