From 6861ecaa415c7c140b726a65cad3d6372e9d543b Mon Sep 17 00:00:00 2001 From: Manoj Ampalam Date: Tue, 28 Nov 2017 21:03:10 -0800 Subject: [PATCH] Fixed service banary paths (#243) PowerShell/Win32-OpenSSH#963 --- contrib/win32/openssh/install-sshd.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/win32/openssh/install-sshd.ps1 b/contrib/win32/openssh/install-sshd.ps1 index bd85fb164..e781a7701 100644 --- a/contrib/win32/openssh/install-sshd.ps1 +++ b/contrib/win32/openssh/install-sshd.ps1 @@ -264,10 +264,10 @@ if (Get-Service ssh-agent -ErrorAction SilentlyContinue) sc.exe delete ssh-agent 1>$null } -New-Service -Name ssh-agent -BinaryPathName $sshagentpath -Description "SSH Agent" -StartupType Manual | Out-Null +New-Service -Name ssh-agent -BinaryPathName `"$sshagentpath`" -Description "SSH Agent" -StartupType Manual | Out-Null cmd.exe /c 'sc.exe sdset ssh-agent D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;RP;;;AU)' -New-Service -Name sshd -BinaryPathName $sshdpath -Description "SSH Daemon" -StartupType Manual -DependsOn ssh-agent | Out-Null +New-Service -Name sshd -BinaryPathName `"$sshdpath`" -Description "SSH Daemon" -StartupType Manual -DependsOn ssh-agent | Out-Null sc.exe config sshd obj= $sshdAccount sc.exe privs sshd SeAssignPrimaryTokenPrivilege