Permalink
Browse files

Get rid of startup scripts

Turns out they don't get preserved when a new VM is made. We'll just
regenerate SSH host keys manually later.
  • Loading branch information...
1 parent 5d5105f commit 4f192f52edbb6a6b2c8b32cfd777f69acd16a6c1 @aroben committed Jul 11, 2012
Showing with 1 addition and 43 deletions.
  1. +0 −1 bootstrap-startup.cmd
  2. +0 −16 bootstrap-startup.ps1
  3. +0 −15 bootstrap-startup.reg
  4. +1 −11 install.ps1
View
@@ -1 +0,0 @@
-powershell -ExecutionPolicy Bypass %~dp0\bootstrap-startup.ps1 >> C:\Users\Administrator\winbootstrap.log
View
@@ -1,16 +0,0 @@
-Set-StrictMode -Version Latest
-
-function Start-Sshd {
- # First we generate new keys in case we're launching on a new VM.
- C:\cygwin\bin\bash.exe --login -- /usr/bin/ssh-host-config --yes
-
- Set-Service sshd -StartupType Automatic
- net start sshd
-}
-
-function Uninstall-StartupScripts {
- reg delete /f "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0"
-}
-
-Start-Sshd
-Uninstall-StartupScripts
View
@@ -1,15 +0,0 @@
-Windows Registry Editor Version 5.00
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0]
-"GPO-ID"="LocalGPO"
-"SOM-ID"="Local"
-"FileSysPath"="C:\\Windows\\System32\\GroupPolicy\\Machine"
-"DisplayName"="Local Group Policy"
-"GPOName"="Local Group Policy"
-"PSScriptOrder"=dword:00000001
-
-[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Startup\0\0]
-"Script"="C:\\cygwin\\home\\Administrator\\bootstrap-startup.cmd"
-"Parameters"=""
-"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
-
View
@@ -19,18 +19,8 @@ function Register-Sshd {
$password = [Web.Security.Membership]::GeneratePassword(16, 4)
C:\cygwin\bin\bash.exe --login -- /usr/bin/ssh-host-config --yes --user cyg_server --pwd $password
netsh advfirewall firewall add rule name=sshd dir=in action=allow program=C:\cygwin\usr\sbin\sshd.exe localport=22 protocol=tcp
- # Don't let sshd start on the next boot until we've had a chance to regenerate the host keys.
- Set-Service sshd -StartupType Disabled
-}
-
-function Install-StartupScripts {
- foreach ($script in (Resolve-Path (Join-Path $scriptDirectory "bootstrap-startup*"))) {
- Copy-Item $script.Path C:\cygwin\home\Administrator
- }
-
- reg import (Join-Path $scriptDirectory bootstrap-startup.reg)
+ net start sshd
}
Install-Cygwin
Register-Sshd
-Install-StartupScripts

0 comments on commit 4f192f5

Please sign in to comment.