summaryrefslogtreecommitdiffstats
path: root/jenkins-server-slave-setup/cygwin-sshd
diff options
context:
space:
mode:
Diffstat (limited to 'jenkins-server-slave-setup/cygwin-sshd')
-rwxr-xr-xjenkins-server-slave-setup/cygwin-sshd/Cygwin-sshd.bat5
-rw-r--r--jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_init.txt87
-rw-r--r--jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_service.txt49
-rw-r--r--jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_usr_process-setupusr.sh5
-rw-r--r--jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_usr_process.txt73
5 files changed, 219 insertions, 0 deletions
diff --git a/jenkins-server-slave-setup/cygwin-sshd/Cygwin-sshd.bat b/jenkins-server-slave-setup/cygwin-sshd/Cygwin-sshd.bat
new file mode 100755
index 0000000..b6ddb51
--- /dev/null
+++ b/jenkins-server-slave-setup/cygwin-sshd/Cygwin-sshd.bat
@@ -0,0 +1,5 @@
+@echo off
+c:
+chdir c:\cygwin\bin
+bash --login -c /usr/sbin/sshd
+bash --login -c /usr/sbin/sshd
diff --git a/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_init.txt b/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_init.txt
new file mode 100644
index 0000000..252f5a2
--- /dev/null
+++ b/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_init.txt
@@ -0,0 +1,87 @@
+cygwin_sshd_win7_init.txt
+=========================
+
+I have read the following 2 howtos ..
+ [1] http://cygwin.com/faq/faq-nochunks.html#faq.using.sshd-in-domain
+ [2] http://www.kgx.net.nz/2010/03/cygwin-sshd-and-windows-7/
+where [2] was really helpfull.
+
+The following is based on [2] and we should be able to config it easily.
+
+Install Cygwin / OpenSSH - ssh daemon/service
+==============================================
+
+In the following writing we will use single quotes
+to quote names, ie 'sshd', or 'jogamp'.
+The quotes are not part of the name,
+but are ment to seperate the name from this text,
+i.e. don't enter the quotes.
+
+1) Create accounts:
+
+- cmd.exe: 'lusrmgr'
+ - Users
+ - New User.. (right click)
+ - User Name: 'jogamp'
+ - Enter a password
+ - Uncheck: User must change password
+ - Check: Password never exires
+ - Right click on 'jogamp' -> properties (optional)
+ - MemberOf
+ - Add: 'Administrators'
+
+ - Repeat this for account: 'cyg_server' ! (only for win7 service)
+ - Same options
+
+ - Repeat this for account: 'sshd' ! (only for win7 service)
+ - Same options, _BUT_ don't add MemberOf 'Administrators'
+
+2) Enable account: Administrator (or use powershell)
+
+- cmd.exe: 'lusrmgr'
+ - enable Administrator
+ - set password for Administrator
+
+3) We need all these passwords, incl. Administrator !!
+Please put them in a text file (user:password), ie c:\admin.txt
+
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+If you are not already run as user 'jogamp',
+please:
+ - LOGOUT OF WINDOWS
+ - LOGIN TO WINDOWS AS USER 'jogamp'
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+4) Install latest cygwin 1.7.5-1 as user 'jogamp'
+ - http://www.cygwin.com/
+ - Answer: For All users
+ - Default location C:\cygwin
+ - Add:
+ - git
+ - openssh
+ - vim
+ - ..
+ - maybe: EVERYTHING but sources !
+
+5) Update cygwin user mappings:
+ - Start cygwin shell as user 'jogamp'
+ - Run:
+ mkpasswd -l > /etc/passwd
+ mkgroup -l > /etc/group
+
+6) Add public keys to each users (Administrator, jogamp, ..) cygwin home ~/.ssh/authorized_keys:
+ - Start cygwin shell as user 'jogamp'
+ ++++++++++
+ - mkdir /home/jogamp/.ssh
+ - cp authorized_keys /home/jogamp/.ssh
+ - chown -R jogamp /home/jogamp/.ssh
+ - chmod 0700 /home/jogamp/.ssh
+ - chmod 0600 /home/jogamp/.ssh/*
+ ++++++++++
+ Repeat the above for account 'Administrator' as well!
+
+Now continue with either:
+ - cygwin_sshd_win7_service.txt
+ - cygwin_sshd_win7_usr_process.txt
+
diff --git a/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_service.txt b/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_service.txt
new file mode 100644
index 0000000..8487cb7
--- /dev/null
+++ b/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_service.txt
@@ -0,0 +1,49 @@
+cygwin_sshd_win7_service.txt
+==============================
+
+Please read cygwin_sshd_win7_init.txt first!
+
+7) Modify account settings for account 'cyg_server' _and_
+configure the ssh deamon, sshd:
+ - Start cygwin shell as Administrator:
+ - start cmd.exe
+ - runas /user:Administrator c:\cygwin\Cygwin.bat
+
+ - 7.1) to configure account 'cyg_server' run the following commands
+ you might want to put it in a shell script, e.g. setup-cyg_server.sh
+ +++++++++
+ editrights.exe -a SeAssignPrimaryTokenPrivilege -u cyg_server
+ editrights.exe -a SeCreateTokenPrivilege -u cyg_server
+ editrights.exe -a SeTcbPrivilege -u cyg_server
+ editrights.exe -a SeServiceLogonRight -u cyg_server
+ editrights.exe -l -u cyg_server
+ +++++++++
+
+ - 7.2) to configure sshd, run the following command:
+ ssh-host-config
+
+ - Answer the followup questions as follows:
+ - Any 'overwrite file': yes (happens if you retry configuration)
+ - Should privilige seperation be used: yes
+ - Do you want to install sshd as a service: yes
+ - Enter the value of CYGWIN for the daemon: [] (nothing, just press return)
+ - Do you want to use a different user: no (using account: cyg_server)
+ - Enter the password for account cyg_server
+
+ - 7.3) start sshd manually for the very first time:
+
+ net start sshd
+
+ sshd will be started automatically after each reboot!
+
+ You can stop and uninstall the service via:
+ net stop sshd
+ cygrunsrv -R sshd
+
+ To use the windows UI, launch:
+ - start: cmd.exe
+ - start: control admintools
+
+ .. and click on services
+
+
diff --git a/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_usr_process-setupusr.sh b/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_usr_process-setupusr.sh
new file mode 100644
index 0000000..a4ca501
--- /dev/null
+++ b/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_usr_process-setupusr.sh
@@ -0,0 +1,5 @@
+editrights.exe -a SeAssignPrimaryTokenPrivilege -u jogamp
+editrights.exe -a SeCreateTokenPrivilege -u jogamp
+editrights.exe -a SeTcbPrivilege -u jogamp
+editrights.exe -a SeServiceLogonRight -u jogamp
+editrights.exe -l -u jogamp
diff --git a/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_usr_process.txt b/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_usr_process.txt
new file mode 100644
index 0000000..766f782
--- /dev/null
+++ b/jenkins-server-slave-setup/cygwin-sshd/cygwin_sshd_win7_usr_process.txt
@@ -0,0 +1,73 @@
+cygwin_sshd_win7_usr_process.txt
+=================================
+
+Please read cygwin_sshd_win7_init.txt first!
+
+7) Modify account settings for account 'jogamp' _and_
+configure the ssh deamon, sshd:
+ - Start cygwin shell as Administrator:
+ - start cmd.exe
+ - runas /user:Administrator c:\cygwin\Cygwin.bat
+
+ - 7.1) to configure account 'jogamp' run the following commands
+ you might want to put it in a shell script, e.g. setup-jogamp.sh
+ +++++++++
+ editrights.exe -a SeAssignPrimaryTokenPrivilege -u jogamp
+ editrights.exe -a SeCreateTokenPrivilege -u jogamp
+ editrights.exe -a SeTcbPrivilege -u jogamp
+ editrights.exe -a SeServiceLogonRight -u jogamp
+ editrights.exe -l -u jogamp
+ +++++++++
+
+ - 7.2) to configure sshd, run the following command:
+ ssh-host-config
+
+ - Answer the followup questions as follows:
+ - Any 'overwrite file': yes (happens if you retry configuration)
+ - Should privilige seperation be used: no
+ - Do you want to install sshd as a service: no
+
+ chown jogamp /etc/ssh*
+
+8) Autostart user 'jogamp' and user space sshd
+
+ 8.1) Autostart sshd for user 'jogamp'
+ Create the sshd startup batch script 'Cygwin-sshd.bat'
+ in 'jogamp' home folder c:\Users\Jogamp
+
+ ++++++++++
+ @echo off
+
+ C:
+ chdir C:\cygwin\bin
+
+ bash --login -c /usr/sbin/sshd
+ ++++++++++
+
+ Create a shortcut to:
+ C:\Users\jogamp\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
+
+ 8.2) Automatic logon of 'jogamp' into windows-7 at boot
+
+ http://www.windows7news.com/2009/02/01/automatic-logon-into-windows-7/
+
+ - start: cmd.exe
+ - start: control userpasswords2
+ - Select the user account 'jogamp' in the main table
+ - Uncheck the “Users must enter a user name and password to use this computer.
+ - Click on the Apply button will open the Automatically Log On window.
+ - Enter the password and confirm it to add the password to the system
+
+9) Start sshd manually for the very first time:
+
+- Double-Click on your created (step 8.1) batch file 'Cygwin-sshd.bat'
+
+- You also need to manually connect to the service
+ to permit port access for this account!
+ A popup will appear.
+ So .. go on a diff machine and try: 'ssh -v jogamp@<IP-Address>'
+
+10) Restart Windows ..
+
+11) Try to login via SSH as user 'jogamp'
+