@@ -8,7 +8,10 @@ if not defined TEMP set TEMP=%USERPROFILE%\AppData\Local\Temp
8
8
if exist " %SystemDrive% \Program Files (x86)" (
9
9
set OPENSSH_URL = " http://www.mls-software.com/files/setupssh-6.6p1-1-v1(x64).exe"
10
10
) 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"
12
15
)
13
16
14
17
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
31
34
32
35
echo ==^ > Stopping opensshd
33
36
sc stop opensshd
37
+ timeout 10
34
38
35
39
echo ==^ > Setting temp location
36
40
rd /S /Q " %ProgramFiles% \OpenSSH\tmp"
37
41
cmd /c " " %ProgramFiles% \OpenSSH\bin\junction.exe" /accepteula " %ProgramFiles% \OpenSSH\tmp" " %windir% \Temp" "
38
42
cmd /c %windir% \System32\icacls.exe " %TEMP% " /grant %USERNAME% :(OI)(CI)F
43
+ mkdir " %USERPROFILE% \.ssh"
39
44
powershell -Command " Add-Content %USERPROFILE% \.ssh\environment 'APPDATA=%SystemDrive% \Users\%USERNAME% \AppData\Roaming'"
40
45
powershell -Command " Add-Content %USERPROFILE% \.ssh\environment 'CommonProgramFiles=%SystemDrive% \Program Files\Common Files'"
41
46
powershell -Command " Add-Content %USERPROFILE% \.ssh\environment 'LOCALAPPDATA=%SystemDrive% \Users\%USERNAME% \AppData\Local'"
@@ -59,13 +64,6 @@ if exist "%SystemDrive%\Program Files (x86)" (
59
64
echo ==^ > Record the path for use by provisioners
60
65
< nul set /p " . = %PATH% " > %TEMP% \PATH
61
66
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
-
69
67
echo ==^ > Fixing opensshd to not be strict
70
68
powershell -Command " (Get-Content '%ProgramFiles% \OpenSSH\etc\sshd_config') | Foreach-Object { $_ -replace 'StrictModes yes', 'StrictModes no' } | Set-Content '%ProgramFiles% \OpenSSH\etc\sshd_config'"
71
69
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
78
76
netsh advfirewall firewall add rule name=" SSHD" dir=in action=allow program=" %ProgramFiles% \OpenSSH\usr\sbin\sshd.exe" enable=yes
79
77
netsh advfirewall firewall add rule name=" ssh" dir=in action=allow protocol=TCP localport=22
80
78
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
+
81
86
echo ==^ > Deleting " %OPENSSH_EXE% "
82
87
del " %OPENSSH_EXE% "
0 commit comments