Installing Cygwin unattended on W2K8
Unattended Install
Unattended Cygwin+Openssh+Some Utils Installation for Windows
1 Download setup.exe from the cygwin web site.
2 Run the installer conventionally, choosing the options for downloading to a local directory without installing anything. Make sure you have the following packege choose:
From Admin, select all packages.
From Archive, select unzip and zip packages.
From Base, leave the default, select all packages.
From Doc, leave the default, man and 'cygwin doc' packages.
From Editors, select vim package.
From Net, select openssh (openssl will get checked automatically), rsync and tcp_wrappers packages.
set to 'Install' in the choose packages page.
3 Run the sed script over the downloaded setup.ini file: (Note: Need a Cygwin installed machine to performe this)
4 This now leaves you with a 'canned' version of Cygwin that will install from the command line as follows:
Note: that the paths you give to setup.exe need to be Windows paths, not Cygwin paths.
"c:\where\you\want\to\put\cygwin" means the cygwin will be installed in to this folder eg. c:\ssh
"c:\path\to\installer\directory" means the package downloaded from Internet. The original directory name is something like "http%3a%2f%2fmirror.csclub.uwaterloo.ca%2fcygwin%2f" rename it and point the install batch file to the realname. eg. c:\ssh\package\release.
4. Right click My Computer, Properties, Advanced, Environment Variables
Click the "New" button to add a new entry to System variables:
variable name is CYGWIN
variable value is ntsec tty
or use this commad: setx CYGWIN "ntsec tty" /m
5. Right click My Computer, Properties, Advanced, Environment Variables
Select the Path variable and click the "Edit" button:
append
or use this command: SET PATH = %PATH%;C:\ssh\bin
How to uninstall/install cygwin under Windows 2008
(From previous attempted failed installations)
In Administrator shell
1. net stop sshd
2. cygrunsrv -R sshd
3. net user
Delete any user listed like sshd or sshd_server.
The following syntax is to be used:
4. rm -R /etc/ssh*
5. mkpasswd -cl > /etc/passwd
6. mkgroup --local > /etc/group
In User shell
1. cd ~
2. rm -R .ssh
***********************************************
7. Installation Steps
In Administrator shell
1. ssh-host-config -y
2. net start sshd
In User shell
1. ssh-user-config (Answer questions as appropriate to your situation)
2. Test connection:
Then go to Control Panel ... Windows Firewall, open inbound TCP port 22.
8. Troubleshooting…
1 SSH-Issue: /bin/bash: Permission denied
Going to cygwin icon from desktop and add
mkpasswd -l > /etc/passwd
mkgroup -l > /etc/group
Then add these 6 commands as work around:
chmod +r
chmod u+w /etc/passwd
chmod +r
chmod u+w /etc/group
chmod
chmod 664 /var/log/sshd.log
editrights -a SeTcbPrivilege -u ssh_service
editrights -a SeAssignPrimaryTokenPriv
editrights -a SeCreateTokenPrivilege -u ssh_service
editrights -a SeDenyInteractiveLogonRi
editrights -a SeDenyNetworkLogonRight -u ssh_service
editrights -a SeDenyRemoteInteractiveL
editrights -a SeIncreaseQuotaPrivilege
editrights -a SeServiceLogonRight -u ssh_service
finally,
net stop sshd
net start sshd
2 SSH-Issue:
Check task manager to see how many bash.exe were running, then issue the following command to kill them all
Taskkill /F /IM bash.exe /T
Taskkill.exe is located in C:\WINDOWS\system32