How to start a SSH daemon on Windows without agonizing pain
Oct 6, 2016
I recently needed to connect via ssh to my windows computer from a Linux server, but I couldn’t figure how to do it since ssh servers for windows are expensive and I don’t want to pay for a software that on Linux comes for free. Some of the typical ssh servers (daemon in linux terminology) are bitvise tunnelier, freesshd.
Then start the installation. As always try to select, when asked, a mirror that is close to you.
For Italian users I warmly suggest bo.garr.it (garr in Bologna).
People who are under a proxy should also set it as asked during installation of cygwin.
Then in the package list you have to search for openssh and install it. It is typically under Net packages.
Another good thing you can do is to install scp, rsync, nano, vim, more, less.
They are the basic editing tools one wants to use.
Then after you’ve installed cygwin, start it with administrator privileges and run the following:
$ ssh-host-config
You will be prompted with a series of questions:
Then start the sshd service:
If everything worked as you expected, you can try to login to yourself
$ ssh localhost
You should be able to connect to yourself without problems.
You may have problems with your Windows firewall.
You have to open the port 22 for ssh.
Open Windows Firewall by clicking the Start button, and then clicking Control Panel.
In the search box, type firewall, and then click Windows Firewall.
In the left pane, click Advanced settings.
If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.
In the Windows Firewall with Advanced Security dialog box, in the left pane, click Inbound Rules, and then, in the right pane, click New Rule.
Follow the instructions in the New Inbound Rule wizard
Then this should be enough to let incoming connections on port 22 from ssh.
If you don’t know how to connect, you have to know your IP address. To get your current IP address:
Start-> Run-> cmd
then from the prompt run ipconfig
C:\Users\foobar> ipconfig
and look under IPv4 address.
So from the outside server you can now connect to your local computer, let’s suppose you windows username is foobar and your windows login password is mypassword and your ip address is XXX.YYY.ZZZ.WWW
$> ssh foobar@XXX.YYY.ZZZ.WWW
then type your windows password mypassword and you are inside!