Secure Shell, known as SSH, allows establishing a secure channel between a local and remote computer. SSH is a set of standards and network protocol used for authentication and data exchange. It uses public-key cryptography to authenticate the remote computer and the user. SSH provide an additional layer of confidentiality and integrity for data exchange between two computers. Public key authentication may be describe as two rosetta pieces the come together and allows authentication. It deciphers the data transmited between two machines. After SSH configuration, the two puzzle pieces are divided between the remote and local computer.
Traditionally, the user login the remote machine with SSH and executes commands. These commands allow tunneling data traffic through designated ports, X11 connections, transfer files. In addition SSH may use sftp and scp protocols and rsync.
This guide deals installing a popular open source ssh, called Openssh on Cygwin. It assumes that you have administrator privileges on Windows XP and know you basic Unix commands. You should also consider yourself an advance user. No, the DVD Recorder is not a cup holder.
Let me preface this guide with a WARNING. The author and this site do not guarantee this process outlined in this guide. It may work for you or it may convolute you system configuration. This guide mainly serves to document what worked for my installation.
- Install Cygwin and ssh
- Test your ssh connection
- Error messages and Basic troubleshooting
- Scratch Pad
Install Cygwin and SSH
Let's start from beginning by installing cygwin and Openssh on Windows XP.
- Login as a Administrator
- Download and install Cygwin
- Create a Cygwin folder like C:\cygwin
- Download Cygwin's setup.exe from http://www.cygwin.com/ to C:\cygwin
- Select Start > Run and type C:\cygwin\setup.exe. Follow the Wizard.
- Select Root Install Directory: C:\cygwin. Install For: "All Users." Select Deafult Text File Type: Unix / binary.
- Select Local Package Directory: C:\cygwin or C:\Temp
- Select your Internet Connection: Direct Connection
- Choose A Download Site: near you.
- Select the following from the package selection windows; openssh, tcp_wrappers, and zlib. You may resize the windows for package details and click the little View button for "Full" view. Click on the plus sign to expand the categories. Select the package by clicking on the word "skip" so that an x appears in Column B. Install at least the following list of packages.
- 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 Libs, select zlib package.
- From Net, select openssh, rsync, tcp_wrappers .
- Click Next to start installing Cygwin and ssh.
Take a break here, because it may take a while depending on the package and your internet connection.
- Right click My Computer > Properties > Advanced > Environment Variables. Under System variables, click the [New] button to and add the follow values in the new entry.
- Variable name: CYGWIN
- Variable value: ntsec tty
- Right click My Computer > Properties > Advanced > Environment Variables. Under System variables, select the Path variable and click the [Edit] button. Append the following to the end of the existing variable string.
- C:\cygwin\bin
- Open a Cygwin window [Start] > Programs > Cygwin > Cygwin; a black screen pops open; type
ssh-host-config.- When the script asks you about "privilege separation", answer yes
- When the script asks about "create local user sshd", answer yes
- When the script asks you about "install sshd as a service", answer yes
- When the script stops and asks you for "CYGWIN=" your answer is ntsec tty
- From Cygwin terminal window (black screen), start the sshd service
net start sshd- or
cygrunsrv --start sshd
- Make sure every Windows user has a password set, if not, go to [Start] > Control Panel > User Accounts and create a password.
- Make sure every Windows user has done the following:
- Login as each Windows user
- Run a console screen by clicking [Start] > Run > cmd
- important Open a Cygwin terminal window, harmonize Windows user information with Cygwin, otherwise they cannot login
mkpasswd -cl > /etc/passwdmkgroup --local > /etc/group
Test your ssh connection
Let's test our sshd installation. Open a Cygwin terminal window (note: the commands below are case sensitive)
whoamissh localhostssh -vvv localhostssh "$USERNAME@127.0.0.1"t
If you get a prompt without error messages, type
ls -lh /cygdrive/c
if you see a directory listing, success!
Type exit to end the cygwin ssh session.
Error messages and basic troubleshooting
If you get an error message like "ssh-exchange-identification: Connection closed by remote host", it is probably caused by McAfee 8.0i
If you have troubles ssh into the server, try run ssh-user-config
If you have a Windows username that contain space, expand the space into \ [space], e.g. if the Windows login name is mickey mouse
ssh mickey\ mouse@127.0.0.1
If you have a Unix system that does not know what to do with TERM cygwin, add these scripts to .login