3 September 2012
Install cygwin sshd on Windows
Posted by pathfinder under: General .
Here is a quick tutorial to install cygwin on your windows computer to make your windows computer an SSH and SFTP SERVER. A couple of house cleaning things before we get started.
- Note: If you are looking for a SSH client then download putty.exe as it make s a great SSH client.
- This tutorial only applies to Cygwin 1.7, installer version 2.774
- I have only installed this twice so I am by far no expert. If I missed a step you will have to figure it out yourself.
Now lets get started.
- First thing you need to do is download the cygwin setup.exe from here Cygwin.com.
- After downloading, run the setup.exe. Click Next and choose Install from Internet.
- Leave the install directly as c:\cygwin (unless you have some specific reason to change it. if you do decide to change, you will be on your own).
- Click next and chose a Local Package directly. In my case I made it my downloads folder “C:\Users\xxxxx\Downloads”
- Click next and leave the default option: Direct Connection.
- Now you will need to choose a download mirror. Go to http://cygwin.com/mirrors.html and find the download location closest to where you live. Find it in the list and select next.
- After a moment you will get a list of packages to install.
- In the Search box type “ssh”
- Expand NET
- Click on the “skip” for the openssh:”The OpenSSH server and client programs”
- Click Next
- You will get a screen to automatically Resolve dependencies. Make sure the RECOMMENED option is selected and Click Next.
- The install may take a few minutes to download the necessary packates. (they will be save to the location you selected in step 4)
- After the packages are downloaded and installed, you will get an option if you want to create shortcuts. I chose to let the install create the shortcuts and clicked finish.
- After installation is finished, open the cygwin terminal as Administrator by righ clicking on the shortcut and choose Run as Administrator.
- In the cygwin terminal type in ssh-host-config
- At the first option “Should privelage separation be used? (yes/no)” type “yes” (this is the default option)
- “new local account ‘sshd’? (yes/no) type “yes”
- “Do you want to install sshd as a service?” Type “yes”
- Next you’ll be asked to “Enter the value of CYGWIN for the daemon: ” Type “ntsec”
- Cygwin will now need to create a user for the service. The default is ‘cyg_server’. To use the default Type “no”.
- You will be prompted for a password (twice) to assign to this account. Enter a password.
- You have completed the install. Type “net start sshd” to start the server.
- Now you will need to create the user keys.
- Exit cygwin by typing in “exit”
- Re-open cygwin-terminal as a normal user by clicking on the cygwin-terminal shortcut. (This will be the user that you will log into ssh terminal with)
- In the Terminal type “ssh-user-config”
- At the prompt “Shall I create a SSH2 RSA identity file for you? (yes/no)” Type “yes”
- enter a passphrase. it can be anything you want.
- At the prompt “Do you want to use this identity to login to this machine (yes/no) Type “yes”
- Next, you’ll be asked to create an SSH2 DSA identiy file, if you want to use password-less access. I declined at this step so I typed “no”
- Next you’ll be asked to create an SSH2 ECDSA identity file. Again I declined and so I typed “no”
- Last you’ll be asked to create a (depricated) SSH1 RSA identity file. I declined this step so I typed “no”
- You have now completed setting up your user.
- The final step is to add the program C:\cygwin\usr\sbin\sshd.exe to your firewall rules.
- Windows Control Panel -> System and Security -> Windows Firewall -> Allow a program through Windows Firewall
- Click Change settings
- Towards the bottom of the screen click “allow another program…”
- Browse to C:\cygwin\usr\sbin\sshd.exe
- Also, I needed to set my password before I could log in with putty from a remote computer, so at the cygwin prompt I typed in “passwd” to set my password. (Note: this will change your windows login password also).
You will now have putty and sftp access to your computer.