Skip to content

Commit

Permalink
5-14 C6
Browse files Browse the repository at this point in the history
  • Loading branch information
manojampalam committed May 15, 2016
1 parent adf15df commit 2d6e648
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 19 deletions.
17 changes: 0 additions & 17 deletions contrib/win32/openssh/Win32-OpenSSH.sln
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssh-add", "ssh-add.vcxproj"
{8660C2FE-9874-432D-B047-E042BB41DBE0} = {8660C2FE-9874-432D-B047-E042BB41DBE0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssh-pubkey", "ssh-pubkey.vcxproj", "{029797FF-C986-43DE-95CD-2E771E86A0AD}"
ProjectSection(ProjectDependencies) = postProject
{05E1115F-8529-46D0-AAAF-52A404CE79A7} = {05E1115F-8529-46D0-AAAF-52A404CE79A7}
{8F9D3B74-8D33-448E-9762-26E8DCC6B2F4} = {8F9D3B74-8D33-448E-9762-26E8DCC6B2F4}
{DD483F7D-C553-4740-BC1A-903805AD0174} = {DD483F7D-C553-4740-BC1A-903805AD0174}
{0D02F0F0-013B-4EE3-906D-86517F3822C0} = {0D02F0F0-013B-4EE3-906D-86517F3822C0}
{8660C2FE-9874-432D-B047-E042BB41DBE0} = {8660C2FE-9874-432D-B047-E042BB41DBE0}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -232,14 +223,6 @@ Global
{029797FF-C986-43DE-95CD-2E771E86AEBC}.Release|x64.Build.0 = Release|x64
{029797FF-C986-43DE-95CD-2E771E86AEBC}.Release|x86.ActiveCfg = Release|Win32
{029797FF-C986-43DE-95CD-2E771E86AEBC}.Release|x86.Build.0 = Release|Win32
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Debug|x64.ActiveCfg = Debug|x64
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Debug|x64.Build.0 = Debug|x64
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Debug|x86.ActiveCfg = Debug|Win32
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Debug|x86.Build.0 = Debug|Win32
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Release|x64.ActiveCfg = Release|x64
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Release|x64.Build.0 = Release|x64
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Release|x86.ActiveCfg = Release|Win32
{029797FF-C986-43DE-95CD-2E771E86A0AD}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
16 changes: 14 additions & 2 deletions contrib/win32/openssh/install-sshd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
$scriptdir = Split-Path $scriptpath

$sshdpath = Join-Path $scriptdir "sshd.exe"
$sshagentpath = Join-Path $scriptdir "ssh-agent.exe"

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

New-Service -Name sshd -BinaryPathName $sshdpath -Description "SSH Deamon" -StartupType Manual | Out-Null
Write-Host -ForegroundColor Green "sshd successfully installed"
if (Get-Service ssh-agent -ErrorAction SilentlyContinue)
{
Stop-Service ssh-agent
sc.exe delete ssh-agent 1> 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 Deamon" -StartupType Manual -DependsOn ssh-agent | Out-Null
sc.exe config sshd obj= "NT SERVICE\SSHD"
Write-Host -ForegroundColor Green "sshd and ssh-agent services successfully installed"

10 changes: 10 additions & 0 deletions contrib/win32/openssh/install-sshlsa.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
copy .\ssh-lsa.dll $env:windir\system32
$subkey = 'SYSTEM\CurrentControlSet\Control\Lsa'
$value = 'Authentication Packages'
$reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 0)
$key = $reg.OpenSubKey($subkey, $true)
$arr = $key.GetValue($value)
if ($arr -notcontains 'ssh-lsa') {
$arr += 'ssh-lsa'
$key.SetValue($value, [string[]]$arr, 'MultiString')
}
12 changes: 12 additions & 0 deletions contrib/win32/openssh/uninstall-sshd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,15 @@ else {
Write-Host -ForegroundColor Yellow "sshd service is not installed"
}

if (Get-Service ssh-agent -ErrorAction SilentlyContinue)
{
Stop-Service ssh-agent
sc.exe delete ssh-agent 1>null
Write-Host -ForegroundColor Green "ssh-agent successfully uninstalled"
}
else {
Write-Host -ForegroundColor Yellow "ssh-agent service is not installed"
}



10 changes: 10 additions & 0 deletions contrib/win32/openssh/uninstall-sshlsa.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$subkey = 'SYSTEM\CurrentControlSet\Control\Lsa'
$value = 'Authentication Packages'
$reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 0)
$key = $reg.OpenSubKey($subkey, $true)
$arr = $key.GetValue($value)
if ($arr -contains 'ssh-lsa') {
$tempArryList = New-Object System.Collections.Arraylist(,$arr)
$tempArryList.Remove('ssh-lsa')
$key.SetValue($value, [string[]]$tempArryList, 'MultiString')
}

0 comments on commit 2d6e648

Please sign in to comment.