Cygwin (www.cygwin.com) Get the free download from www.cygwin.com - loads of info for installation and use on this page. Cygwin is a free robust unix environment running on Windows platforms. Features: - rich tool set of unix commands (awk, cron,find, grep, rsh, sed, tar, ...) - unix mail tools (mutt, ssmtp) - ssh/scp/sftp capabilities - editor (vim) - developer environment (gcc, make, perl, lex, ...) - ALL these tools can work on the Microsoft filesystems, meaning you can 'vi c:\somefile.txt' or you can do a 'df -h' and see your free/used space on all drives including shares. Some items to note: Suggested install directory names: install root dir: c:/cygwin # this is / (root) local package dir: c:/cygwin-install # this is where things are built from. # do not delete or it will loose # knowledge of what you # have installed and where Devel : select gcc Editor : select vim Math : select bc Interpreters : expect expect, perl Net : select curl, ssh (openssh), ping, rsync, whois Utils : select file, bzip2, diffutils, time, util-linux, units, which web : select all by choosing "install" X11 : select all by choosing "install" Accounts created under cygwin NT & > : administrator 95/98 : the username you installed cygwin as Add users and groups *LOCAL (recommended) Acounts mkpasswd -l -g > /etc/passwd DOMAIN Accounts mkpasswd -d -g > /etc/passwd BOTH mkpasswd -l -d -g > /etc/passwd *LOCAL (recommended) Groups mkgroup -l > /etc/group DOMAIN Groups mkgroup -d > /etc/group Shells bash, sh, tcsh bash is default shell Terminals You get a DOS shell by default rxvt is provided (lean xterm) rxvt -e SHELL_TYPE i.e. rxvt -e bash To get "less" to work as "more" cd /bin; ln -s less more In your .profile, LESS="-X -E";export LESS To get ksh to work cd /bin; ln -s bash ksh To get "print" to work as an "echo" and not a lpr/lp (printers) command cd /bin; ln -s echo print Useful softlink cd c: mkdir TEMP ln -s temp tmp Setup your properties in the cygwin shell window for scrolling: Properties Options Cursor Size: Large select Quickedit Mode select Insert Mode Layout Screen Buffer Size (vertical buffering): Height 2000 Colors I like to make the background white, text black Modify shortcut that started this window. Close window and reopen. Cut and paste dos cmd: highlight, then CR|ENTER to get the hightlighted text into the buffer. Paste with right mouse. rxvt: highlight. Paste by both mouse buttons or middle. Checks cygcheck -s sys cygcheck -c files Screen clear If it doesn't work, create a file "file /usr/bin/clear" Either load "ncurses", which contains a clear.exe. Or, try doing: vi /usr/bin/clear (and add the following line) cmd /c cls chmod 755 /usr/bin/clear get Xwin/xterm stuff X-Windows startx xhost + ipconfig #use IP for DISPLAY setting on the client OLD wm fvwm & agent /bin/startxwin.sh /etc/system.fvwm2rc then startxwin.sh email ssmtp /usr/bin/ssmtp-conf cd /usr/lib; ln s /usr/sbin/ssmtp sendmail Interesting commands see full process list: ps -W auxww (-W show windows processes along with users) ================================================================================ 1. Download cygwin from http://cygwin.com/. Run the setup program and select the packages you want. The simplest thing to do is to get the default packages that are selected for you by the installer, plus "cygrunsrv" from the admin category and "openssh" from the net category. I found installing cygwin to be the easiest part of the process, and if you get stuck there's lot's of great help out there... 2. Edit C:cygwincygwin.bat. Make sure it contains the following setting for the CYGWIN environmental variable: set CYGWIN=binmode tty ntsec 2. Start a cygwin bash shell. If cygwin installed correctly, you should be able to find it in start->programs->cygwin. 3. Make sure cygrunsrv is installed by typing "cygrunsrv -S sshd". This is the command that will start the sshd server, but that's not installed yet. If you get an error from cygrunsrv like "service does not exist" then you're on the right track. If you get "command cygrunsrv not found" then go back over your install and make sure you get cygrunsrv. 4. Again from the bash shell, run ssh-host-config. Answer yes to the key generation questions. I found it easier not to use privilege separation. Answer yes to install as a service. 5. Start sshd with "cygrunsrv -S sshd" ("cygrunsrv -E sshd" shuts it down). At this point you should also have "Cygwin sshd" available as a service that you can start and stop from start->control panel->administrative tools->computer management - go to the services and applications->services list. 6. If all that went well, you should be able to ssh to the server("ssh localhost -l loginName"). At this point only user accounts that existed before your cygwin install and had administrator access will work. This and the next step were the biggest gotchas for me in this whole game. 7. To enable a user to log in via ssh: You should know that sshd looks for information in the comments field of /etc/passwd and coordinates it with NT permissions. This was mentioned but not explained in the howtos I read. Here's how make it work: First, create the NT user and make them part of the administrators group. Next, use the mkpasswd command to format a special passwd entry for that user. You can look at the output with the command "mkpasswd -l". Then either cut and paste the info you need into your /etc/passwd file, or use the command "mkpasswd -l > /etc/passwd". This second will overwrite your existing passwd file. No matter what you do, make a copy of /etc/passwd before making any changes. Create home directories for your users with the following commands: "mkdir /home/userLogin"; "chown userLogin /home/userLogin" Sshd only reads /etc/passwd once when it starts, so stop and start the server after you make changes to /etc/passwd. ================================================================================ IF you want your windows hosts file to work like /etc/hosts, you need to do a "run as administrator" for privs to edit it on newer windows versions. Add your entries just like you always would on unix. It is a link /etc/hosts -> /cygdrive/c/Windows/system32/drivers/etc/hosts ================================================================================