Cygwin installation
From ControlTier
This document describes creating a Unix-centric OpenSSH/Cygwin installation designed to make a Windows server look as much like a Unix system as possible when accessed from the network in order to simplify managing a few Windows based systems in largely Unix based environment.
Contents |
Cygwin software installation
- Create a local or domain Windows administrator account that has a POSIX user name (I use the "build" account for these notes).
- Download and run the Cygwin installer. http://www.cygwin.com/
- The cleanest way to install Cygwin in the root of its own dedicated partition since it is absolutely necessary that the Cygwin root directory is synonymous with the Windows file system root for that drive so that Java's platform agnostic path management will work equally well with the Unix or Windows versions of key paths. Using a separate partition is desirable in order to separate the application installation (under ControlTier and Cygwin) from the Windows OS installation (typically on drive C:):
$ df -k Filesystem 1K-blocks Used Available Use% Mounted on E:\bin 20964348 213848 20750500 2% /usr/bin E:\lib 20964348 213848 20750500 2% /usr/lib E: 20964348 213848 20750500 2% / c: 8377864 7003552 1374312 84% /cygdrive/c $ cd / $ ls Cygwin.bat RECYCLER bin dev home proc usr Cygwin.ico System Volume Information cygdrive etc lib tmp var
If this is not feasible then ignore the warnings and select "C:\" as the installation root directory to create a "hybrid" directory structure:
$ pwd / $ ls AUTOEXEC.BAT MSDOS.SYS WINDOWS home tmp CONFIG.SYS MSOCache bin lib usr Cygwin.bat NTDETECT.COM boot.ini ntldr var Cygwin.ico Program Files cygdrive pagefile.sys Documents and Settings RECYCLER cygwin proc IO.SYS System Volume Information etc
Beyond the base package set make sure you include "openssh" (and hence its dependencies). Of course, there are many many other useful packages that you'll probably like to include for a practical installation of Cygwin (e.g. "rsync", "unzip", "zip", "vim", etc).
Misc configuration
Other issues you may have to deal with after installing Cygwin....
- Double-check key file permissions:
- chmod 644 /etc/passwd
- chmod 644 /etc/group
- chmod 1775 /var
- Update group membership
- change local account's supernumerary group membership to include "Administrators" (i.e. edit /etc/group) if you want the user to be able to use administrator privileges from the Cygwin environment.
SSH server configuration
Cygwin includes a script to configure the SSH service, run from a "Cygwin Bash Shell" (Note the value given to the CYGWIN environment variable. Note also my comment to the original posting regarding W2k3 Server complications) :
$ ssh-host-config Generating /etc/ssh_config file Privilege separation is set to yes by default since OpenSSH 3.3. However, this requires a non-privileged account called 'sshd'. For more info on privilege separation read /usr/share/doc/openssh/README.privsep . Should privilege separation be used? (yes/no) yes Generating /etc/sshd_config file Warning: The following functions require administrator privileges! Do you want to install sshd as service? (Say "no" if it's already installed as service) (yes/no) yes Which value should the environment variable CYGWIN have when sshd starts? It's recommended to set at least "ntsec" to be able to change user context without password. Default is "ntsec". CYGWIN=binmode ntsec tty The service has been installed under LocalSystem account. To start the service, call `net start sshd' or `cygrunsrv -S sshd'. Host configuration finished. Have fun!
Start the SSH service:
$ net start sshd The CYGWIN sshd service is starting. The CYGWIN sshd service was started successfully.
Java installation
Naturally, you can use the Windows system default Java installation so long as its either Java 1.4 or 1.5. However, it may be preferable to install a version of Java specifically for the use of ControlTier. By convention this is installed into "$CTIER_ROOT/pkgs" (usually "$HOME/ctier/pkgs" of the account used to run ControlTier).
Note that although Sun distributes its JDK in Windows (graphical) installer format, there's nothing stopping you creating a Zip file of a "reference" installation and using that to setup Java across the network.
Wherever Java is installed, set up the JAVA_HOME environment variable ahead of the ControlTier installation.
If your system java is installed in the default location C:\Program Files\Java\jdk1.5.0\ then you need to escape the space in "Program Files" using a backslash, like this: C:/Program\ Files/Java/jdk1.5.0/
Alternatively, you can just copy the jdk1.5.0 folder into your controltier pkgs installation directory and just the set the JAVA_HOME variable accordingly, sidestepping the problem with spaces.
ControlTier installation
ControlTier 3.4.7 has added direct support for installation of the ControlTier client on Cygwin based Windows Nodes.
You can follow these instructions to install the client software.
Before continuing, please read the normal ZIP installer (client-only) directions, and decide which options to pass to the install.sh script.
Environment
Setup the key environment variables with Windows paths using the unix forward-slash separator:
$ export CTIER_ROOT=C:/ctier $ export JAVA_HOME=C:/ctier/pkgs/jdk1.5.0_14
Install Script
Execute the install.sh script from the Cygwin Bash shell:
$ sh install.sh --client -Dserver.hostname=ctierserver
-check-prereqs:
[echo] Using compatible Java version: 1.5
-load-props:
[echo] System hostname: wiley
[echo] Node OS Family is 'cygwin'
[echo] Using CTIER_ROOT: C:/ctier
[echo] Using server HOSTNAME: gozer
[echo] Using client HOSTNAME: wiley
.
.
.
echo-rcfile-info:
[echo]
[echo] A .ctierrc file was generated at:
[echo] C:\ICW\home\ctier\.ctierrc
[echo] containing the appropriate environment variables for the installed
[echo] ControlTier Client To use it, add the following to your .profile
[echo] or equivalent:
[echo]
[echo] if [ -f ~/.ctierrc ]; then
[echo] . ~/.ctierrc
[echo] else
[echo] echo ~/.ctierrc not found 1>&2
[echo] fi
install-client:
[echo] Install Complete
Setup build successful.
A ".ctierrc" file will be created in the Cygwin user's home directory to ensure the correct shell environment is available when executing commands. You should make sure to "source" the file from your ".profile" or ".bashrc" file as appropriate.
$ pwd /home/build $ cat .ctierrc # this file was generated by ControlTier installer. export CTIER_ROOT=C:\\ctier export CTL_HOME=C:\\ctier\\pkgs\\ctl-1.4.7 export CTL_BASE=C:\\ctier\\ctl export PATH=$CTL_HOME/bin:$PATH if [ -n "$BASH" ] ; then . $CTL_HOME\\etc\\bash_completion.sh ; if [ -t 0 -a -z "$CTL_CLI_TERSE" ] then CTL_CLI_TERSE=true export CTL_CLI_TERSE fi fi
- Note: When install.sh is executed under cygwin, it simply invokes the install.bat script with an additional parameter "-Dcygwin=true". This parameter configures the .ctierrc file correctly for cygwin. The install.bat script can be used directly for non-cygwin Windows installations.
| ||||||||||||||