Skip to content

Commit a504c8b

Browse files
author
Mischa Taylor
committed
Despite the workarounds which work for the 64-bit Windows 8.1 with Update,
they do not seem to work for the 32-bit version. It looks like the 32-bit version of openssh with the heartbleed fix needs to be rebased. For now, reverting back to the older version. Be careful what you do on a 32-bit VM, as it is heartbleed-vulnerable
1 parent 6ae4c0a commit a504c8b

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

Makefile

+10
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ $(VMWARE_BOX_DIR)/win81x64-enterprise$(BOX_SUFFIX): win81x64-enterprise.json
9292
mkdir -p $(VMWARE_BOX_DIR)
9393
packer build -only=$(VMWARE_BUILDER) $(PACKER_VARS) -var "iso_url=$(WIN81_X64_ENTERPRISE)" $<
9494

95+
$(VMWARE_BOX_DIR)/win81x86-enterprise$(BOX_SUFFIX): win81x86-enterprise.json
96+
rm -rf $(VMWARE_OUTPUT)
97+
mkdir -p $(VMWARE_BOX_DIR)
98+
packer build -only=$(VMWARE_BUILDER) $(PACKER_VARS) -var "iso_url=$(WIN81_X86_ENTERPRISE)" $<
99+
95100
#win2008r2-datacenter-cygwin.json
96101
#win2008r2-datacenter.jso
97102
#win2008r2-enterprise-cygwin.jso
@@ -170,6 +175,11 @@ $(VIRTUALBOX_BOX_DIR)/win81x64-enterprise$(BOX_SUFFIX): win81x64-enterprise.json
170175
mkdir -p $(VIRTUALBOX_BOX_DIR)
171176
packer build -only=$(VIRTUALBOX_BUILDER) $(PACKER_VARS) -var "iso_url=$(WIN81_X64_ENTERPRISE)" $<
172177

178+
$(VIRTUALBOX_BOX_DIR)/win81x86-enterprise$(BOX_SUFFIX): win81x86-enterprise.json
179+
rm -rf $(VIRTUALBOX_OUTPUT)
180+
mkdir -p $(VIRTUALBOX_BOX_DIR)
181+
packer build -only=$(VIRTUALBOX_BUILDER) $(PACKER_VARS) -var "iso_url=$(WIN81_X86_ENTERPRISE)" $<
182+
173183
list:
174184
@for builder in $(BUILDER_TYPES) ; do \
175185
for box_filename in $(BOX_FILENAMES) ; do \

floppy/openssh.bat

+13-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ if not defined TEMP set TEMP=%USERPROFILE%\AppData\Local\Temp
88
if exist "%SystemDrive%\Program Files (x86)" (
99
set OPENSSH_URL="http://www.mls-software.com/files/setupssh-6.6p1-1-v1(x64).exe"
1010
) else (
11-
set OPENSSH_URL="http://www.mls-software.com/files/setupssh-6.6p1-1-v1.exe"
11+
:: Does not seem to work on 32-bit Windows 8.1 with Update, using
12+
:: pre-heartbleed patch (for now)
13+
:: set OPENSSH_URL="http://www.mls-software.com/files/setupssh-6.6p1-1-v1.exe"
14+
set OPENSSH_URL="http://www.mls-software.com/files/setupssh-6.4p1-1.exe"
1215
)
1316

1417
for %%i in (%OPENSSH_URL%) do SET OPENSSH_EXE="%TEMP%\%%~nxi"
@@ -31,11 +34,13 @@ cmd /c "%OPENSSH_EXE%" /S /port=22 /privsep=1 /password=D@rj33l1ng
3134

3235
echo ==^> Stopping opensshd
3336
sc stop opensshd
37+
timeout 10
3438

3539
echo ==^> Setting temp location
3640
rd /S /Q "%ProgramFiles%\OpenSSH\tmp"
3741
cmd /c ""%ProgramFiles%\OpenSSH\bin\junction.exe" /accepteula "%ProgramFiles%\OpenSSH\tmp" "%windir%\Temp""
3842
cmd /c %windir%\System32\icacls.exe "%TEMP%" /grant %USERNAME%:(OI)(CI)F
43+
mkdir "%USERPROFILE%\.ssh"
3944
powershell -Command "Add-Content %USERPROFILE%\.ssh\environment 'APPDATA=%SystemDrive%\Users\%USERNAME%\AppData\Roaming'"
4045
powershell -Command "Add-Content %USERPROFILE%\.ssh\environment 'CommonProgramFiles=%SystemDrive%\Program Files\Common Files'"
4146
powershell -Command "Add-Content %USERPROFILE%\.ssh\environment 'LOCALAPPDATA=%SystemDrive%\Users\%USERNAME%\AppData\Local'"
@@ -59,13 +64,6 @@ if exist "%SystemDrive%\Program Files (x86)" (
5964
echo ==^> Record the path for use by provisioners
6065
<nul set /p ".=%PATH%" > %TEMP%\PATH
6166

62-
echo ==^> Ensuring vagrant can login
63-
mkdir "%USERPROFILE%\.ssh"
64-
cmd /c %windir%\System32\icacls.exe "%USERPROFILE%" /grant %USERNAME%:(OI)(CI)F
65-
cmd /c %windir%\System32\icacls.exe "%ProgramFiles%\OpenSSH\bin" /grant %USERNAME%:(OI)RX
66-
cmd /c %windir%\System32\icacls.exe "%ProgramFiles%\OpenSSH\usr\sbin" /grant %USERNAME%:(OI)RX
67-
powershell -Command "(Get-Content '%ProgramFiles%\OpenSSH\etc\passwd') | Foreach-Object { $_ -replace '/home/(\w+)', '/cygdrive/c/Users/$1' } | Set-Content '%ProgramFiles%\OpenSSH\etc\passwd'"
68-
6967
echo ==^> Fixing opensshd to not be strict
7068
powershell -Command "(Get-Content '%ProgramFiles%\OpenSSH\etc\sshd_config') | Foreach-Object { $_ -replace 'StrictModes yes', 'StrictModes no' } | Set-Content '%ProgramFiles%\OpenSSH\etc\sshd_config'"
7169
powershell -Command "(Get-Content '%ProgramFiles%\OpenSSH\etc\sshd_config') | Foreach-Object { $_ -replace '#PubkeyAuthentication yes', 'PubkeyAuthentication yes' } | Set-Content '%ProgramFiles%\OpenSSH\etc\sshd_config'"
@@ -78,5 +76,12 @@ netsh advfirewall firewall add rule name="SSHD" dir=in action=allow service=Open
7876
netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="%ProgramFiles%\OpenSSH\usr\sbin\sshd.exe" enable=yes
7977
netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
8078

79+
echo ==^> Ensuring vagrant can login
80+
mkdir "%USERPROFILE%\.ssh"
81+
cmd /c %windir%\System32\icacls.exe "%USERPROFILE%" /grant %USERNAME%:(OI)(CI)F
82+
cmd /c %windir%\System32\icacls.exe "%ProgramFiles%\OpenSSH\bin" /grant %USERNAME%:(OI)RX
83+
cmd /c %windir%\System32\icacls.exe "%ProgramFiles%\OpenSSH\usr\sbin" /grant %USERNAME%:(OI)RX
84+
powershell -Command "(Get-Content '%ProgramFiles%\OpenSSH\etc\passwd') | Foreach-Object { $_ -replace '/home/(\w+)', '/cygdrive/c/Users/$1' } | Set-Content '%ProgramFiles%\OpenSSH\etc\passwd'"
85+
8186
echo ==^> Deleting "%OPENSSH_EXE%"
8287
del "%OPENSSH_EXE%"

floppy/zz-start-sshd.cmd

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ sc query opensshd >nul 2>nul && set SSH_SERVICE=opensshd
1414

1515
echo ==^> Starting the %SSH_SERVICE% service
1616
sc start %SSH_SERVICE%
17+
timeout 10

win81x86-enterprise.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"floppy/_download.cmd",
2626
"floppy/_packer_config.cmd",
2727
"floppy/passwordchange.bat",
28-
"floppy/zz-start-sshd.cmd",
29-
"floppy/openssh.bat"
28+
"floppy/openssh.bat",
29+
"floppy/zz-start-sshd.cmd"
3030
],
3131
"tools_upload_flavor": "windows",
3232
"shutdown_command": "shutdown /s /t 1 /f /d p:4:1 /c 'Packer Shutdown'",

0 commit comments

Comments
 (0)