|
| 1 | +1. Downloading Cygwin |
| 2 | + - download cygwin setup.exe and run it |
| 3 | + - choose an appropriate mirror |
| 4 | + Note: I will assume that Cygwin will be installed into C:\Programs\Cygwin. Do not install Cygwin into a folder that contains a space character (C:\Program Files). If you do so, you will face many random and unexpected troubles. |
| 5 | +2. Install from packages, choose the following: |
| 6 | + - OpenSSH, |
| 7 | + - tcp_wrappers, |
| 8 | + - diffutils [this should be pre-selected], |
| 9 | + - zlib |
| 10 | + |
| 11 | + proceed with installation until it is finished. |
| 12 | + |
| 13 | +3. Configuring Cygwin |
| 14 | + |
| 15 | + - run CygWin Bash Shell with Administrator privileges (C:\cygwin\Cygwin.bat) |
| 16 | + - from this Bash shell run ssh-host-config |
| 17 | + - say “yes” to privilege separation |
| 18 | + - say “yes” to create the sshd account |
| 19 | + - say “yes” to install sshd as a service |
| 20 | + - press to enter an empty value of CYGWIN for the daemon |
| 21 | + - Now Cygwin needs to create a new account that will be used as a “proxy”/setuid origin account. Say “no” to use the default name (cyg_server). |
| 22 | + - say “yes” to create a new privileged account cyg_server. |
| 23 | + - create a password for this new privileged account and confirm it |
| 24 | + - synchronize Windows user accounts with Cygwin user accounts: |
| 25 | + mkpasswd -cl > /etc/passwd |
| 26 | + mkgroup --local > /etc/group |
| 27 | + - start SSH server with net start sshd |
| 28 | + |
| 29 | + - test connection with 'ssh localhost' from Cygwin Bash Shell. |
| 30 | + say “yes” to check and store server fingerprint |
| 31 | + put your Windows account password to authenticate |
| 32 | + issue a few test commands in the remote session |
| 33 | + close session with exit. |
| 34 | + alternatively: test your SSHD with putty. |
| 35 | + |
| 36 | +4. Common issues |
| 37 | + - Connection closed by ::1 error |
| 38 | + => How to fix? |
| 39 | + + Check your hosts file: C:\Windows\System32\drivers\etc\hosts |
| 40 | + + Uncomment two lines: |
| 41 | + 127.0.0.1 localhost |
| 42 | + ::1 localhost |
| 43 | + + Uninstall current sshd |
| 44 | + # Remove sshd service |
| 45 | + cygrunsrv --stop sshd |
| 46 | + cygrunsrv --remove sshd |
| 47 | + # Delete any sshd or related users (such as cyg_server) from /etc/passwd |
| 48 | + # (use your favorite editor) |
| 49 | + # Delete any sshd or relaged users (such as cyg_server) from the system |
| 50 | + net user sshd /delete |
| 51 | + net user cyg_server /delete |
| 52 | + + Re-install sshd (as step 3.) |
| 53 | + |
0 commit comments