Skip to content

Commit 2d6e648

Browse files
committed
5-14 C6
1 parent adf15df commit 2d6e648

File tree

5 files changed

+46
-19
lines changed

5 files changed

+46
-19
lines changed

contrib/win32/openssh/Win32-OpenSSH.sln

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssh-add", "ssh-add.vcxproj"
9595
{8660C2FE-9874-432D-B047-E042BB41DBE0} = {8660C2FE-9874-432D-B047-E042BB41DBE0}
9696
EndProjectSection
9797
EndProject
98-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssh-pubkey", "ssh-pubkey.vcxproj", "{029797FF-C986-43DE-95CD-2E771E86A0AD}"
99-
ProjectSection(ProjectDependencies) = postProject
100-
{05E1115F-8529-46D0-AAAF-52A404CE79A7} = {05E1115F-8529-46D0-AAAF-52A404CE79A7}
101-
{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4} = {8F9D3B74-8D33-448E-9762-26E8DCC6B2F4}
102-
{DD483F7D-C553-4740-BC1A-903805AD0174} = {DD483F7D-C553-4740-BC1A-903805AD0174}
103-
{0D02F0F0-013B-4EE3-906D-86517F3822C0} = {0D02F0F0-013B-4EE3-906D-86517F3822C0}
104-
{8660C2FE-9874-432D-B047-E042BB41DBE0} = {8660C2FE-9874-432D-B047-E042BB41DBE0}
105-
EndProjectSection
106-
EndProject
10798
Global
10899
GlobalSection(SolutionConfigurationPlatforms) = preSolution
109100
Debug|x64 = Debug|x64
@@ -232,14 +223,6 @@ Global
232223
{029797FF-C986-43DE-95CD-2E771E86AEBC}.Release|x64.Build.0 = Release|x64
233224
{029797FF-C986-43DE-95CD-2E771E86AEBC}.Release|x86.ActiveCfg = Release|Win32
234225
{029797FF-C986-43DE-95CD-2E771E86AEBC}.Release|x86.Build.0 = Release|Win32
235-
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Debug|x64.ActiveCfg = Debug|x64
236-
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Debug|x64.Build.0 = Debug|x64
237-
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Debug|x86.ActiveCfg = Debug|Win32
238-
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Debug|x86.Build.0 = Debug|Win32
239-
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Release|x64.ActiveCfg = Release|x64
240-
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Release|x64.Build.0 = Release|x64
241-
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Release|x86.ActiveCfg = Release|Win32
242-
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Release|x86.Build.0 = Release|Win32
243226
EndGlobalSection
244227
GlobalSection(SolutionProperties) = preSolution
245228
HideSolutionNode = FALSE

contrib/win32/openssh/install-sshd.ps1

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
$scriptdir = Split-Path $scriptpath
33

44
$sshdpath = Join-Path $scriptdir "sshd.exe"
5+
$sshagentpath = Join-Path $scriptdir "ssh-agent.exe"
56

67
if (-not (Test-Path $sshdpath)) {
78
throw "sshd.exe is not present in script path"
@@ -13,5 +14,16 @@ if (Get-Service sshd -ErrorAction SilentlyContinue)
1314
sc.exe delete sshd 1> null
1415
}
1516

16-
New-Service -Name sshd -BinaryPathName $sshdpath -Description "SSH Deamon" -StartupType Manual | Out-Null
17-
Write-Host -ForegroundColor Green "sshd successfully installed"
17+
if (Get-Service ssh-agent -ErrorAction SilentlyContinue)
18+
{
19+
Stop-Service ssh-agent
20+
sc.exe delete ssh-agent 1> null
21+
}
22+
23+
New-Service -Name ssh-agent -BinaryPathName $sshagentpath -Description "SSH Agent" -StartupType Manual | Out-Null
24+
cmd.exe /c 'sc.exe sdset ssh-agent D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;RP;;;AU)'
25+
26+
New-Service -Name sshd -BinaryPathName $sshdpath -Description "SSH Deamon" -StartupType Manual -DependsOn ssh-agent | Out-Null
27+
sc.exe config sshd obj= "NT SERVICE\SSHD"
28+
Write-Host -ForegroundColor Green "sshd and ssh-agent services successfully installed"
29+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
copy .\ssh-lsa.dll $env:windir\system32
2+
$subkey = 'SYSTEM\CurrentControlSet\Control\Lsa'
3+
$value = 'Authentication Packages'
4+
$reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 0)
5+
$key = $reg.OpenSubKey($subkey, $true)
6+
$arr = $key.GetValue($value)
7+
if ($arr -notcontains 'ssh-lsa') {
8+
$arr += 'ssh-lsa'
9+
$key.SetValue($value, [string[]]$arr, 'MultiString')
10+
}

contrib/win32/openssh/uninstall-sshd.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,15 @@ else {
88
Write-Host -ForegroundColor Yellow "sshd service is not installed"
99
}
1010

11+
if (Get-Service ssh-agent -ErrorAction SilentlyContinue)
12+
{
13+
Stop-Service ssh-agent
14+
sc.exe delete ssh-agent 1>null
15+
Write-Host -ForegroundColor Green "ssh-agent successfully uninstalled"
16+
}
17+
else {
18+
Write-Host -ForegroundColor Yellow "ssh-agent service is not installed"
19+
}
20+
21+
22+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
$subkey = 'SYSTEM\CurrentControlSet\Control\Lsa'
2+
$value = 'Authentication Packages'
3+
$reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 0)
4+
$key = $reg.OpenSubKey($subkey, $true)
5+
$arr = $key.GetValue($value)
6+
if ($arr -contains 'ssh-lsa') {
7+
$tempArryList = New-Object System.Collections.Arraylist(,$arr)
8+
$tempArryList.Remove('ssh-lsa')
9+
$key.SetValue($value, [string[]]$tempArryList, 'MultiString')
10+
}

0 commit comments

Comments
 (0)