Skip to content

Commit

Permalink
Merge pull request #403 from lemeurherve/fix-open-ssh-9-5
Browse files Browse the repository at this point in the history
Bump OpenSSH to v9.5.0.0p1-beta and fix its installation on nanoserver
  • Loading branch information
lemeurherve authored May 15, 2024
2 parents 2fcb348 + 12dc1c7 commit 110b752
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions windows/nanoserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,18 @@ ENV JENKINS_AGENT_USER ${user}
ENV JENKINS_AGENT_WORK ${JENKINS_AGENT_WORK}

# Setup SSH server
ARG OPENSSH_VERSION=V8.6.0.0p1-Beta
ARG OPENSSH_VERSION=v9.5.0.0p1-Beta
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
$url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ; `
Write-Host "Retrieving $url..." ; `
Invoke-WebRequest -Uri $url -OutFile C:/openssh.zip -UseBasicParsing ; `
Expand-Archive c:/openssh.zip 'C:/Program Files' ; `
Remove-Item C:/openssh.zip ; `
$env:PATH = '{0};{1}' -f $env:PATH,'C:\Program Files\OpenSSH-Win64' ; `
& 'C:/Program Files/OpenSSH-Win64/Install-SSHd.ps1' ; `
if(!(Test-Path 'C:\ProgramData\ssh')) { New-Item -Type Directory -Path 'C:\ProgramData\ssh' | Out-Null } ; `
icacls 'C:\ProgramData\ssh' /inheritance:d ; `
icacls 'C:\ProgramData\ssh' /remove 'CREATOR OWNER' ; `
& 'C:/Program Files/OpenSSH-Win64/Install-SSHd.ps1' ; `
Copy-Item 'C:\Program Files\OpenSSH-Win64\sshd_config_default' 'C:\ProgramData\ssh\sshd_config' ; `
$content = Get-Content -Path "C:\ProgramData\ssh\sshd_config" ; `
$content | ForEach-Object { $_ -replace '#PermitRootLogin.*','PermitRootLogin no' `
Expand Down
2 changes: 1 addition & 1 deletion windows/windowsservercore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ RUN $CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\contr
& C:\mingit\cmd\git.exe lfs install

# Setup SSH server
ARG OPENSSH_VERSION=V8.6.0.0p1-Beta
ARG OPENSSH_VERSION=v9.5.0.0p1-Beta
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
$url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/{0}/OpenSSH-Win64.zip' -f $env:OPENSSH_VERSION ; `
Write-Host "Retrieving $url..." ; `
Expand Down

0 comments on commit 110b752

Please sign in to comment.