From 4f87e35d14021b1438299360f3ffa5b0c7ca4c2e Mon Sep 17 00:00:00 2001 From: manojampalam Date: Tue, 17 May 2016 19:09:35 -0700 Subject: [PATCH] updated install script to accomodate spaces in directory paths --- contrib/win32/openssh/install-sshd.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/win32/openssh/install-sshd.ps1 b/contrib/win32/openssh/install-sshd.ps1 index 5d0d1ac..1906edb 100644 --- a/contrib/win32/openssh/install-sshd.ps1 +++ b/contrib/win32/openssh/install-sshd.ps1 @@ -4,7 +4,7 @@ $scriptdir = Split-Path $scriptpath $sshdpath = Join-Path $scriptdir "sshd.exe" $sshagentpath = Join-Path $scriptdir "ssh-agent.exe" -$ntrights = Join-Path $scriptdir "ntrights.exe -u `"NT SERVICE\SSHD`" +r SeAssignPrimaryTokenPrivilege" +$ntrights = "ntrights.exe -u `"NT SERVICE\SSHD`" +r SeAssignPrimaryTokenPrivilege" if (-not (Test-Path $sshdpath)) { 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 New-Service -Name sshd -BinaryPathName $sshdpath -Description "SSH Deamon" -StartupType Manual -DependsOn ssh-agent | Out-Null sc.exe config sshd obj= "NT SERVICE\SSHD" + +Push-Location +cd $scriptdir cmd.exe /c $ntrights +Pop-Location Write-Host -ForegroundColor Green "sshd and ssh-agent services successfully installed"