SSH Daemon - Setup with Cygwin

From SecurityForest


Tutorial by Loni
How-to setup an SSH daemon using Cygwin (Only tested on windows 2000)
Table of contents

What is Cygwin?

Cygwin is a Linux-like environment for Windows. It consists of two parts:
- A DLL (cygwin1.dll) which acts as a Linux emulation layer providing substantial Linux
  API functionality 
- A collection of tools, which provide Linux look and feel. 

General Note: I may have ripped some of this information from other sources written on the subject. One of the main reasons for writing this is so I have documentation of how I managed to get it to work on my system.

Usual security/hacking disclaimer applies.

Install Cygwin by running the setup.exe utility found on http://www.cygwin.com

Make sure you install the following:

Admin -> Cygrunsrv
Net   -> OpenSSH

Edit the cygwin.bat file and add the CYGWIN environmental variable

notepad d:\cygwin\cygwin.bat

add the following:
    set CYGWIN=binmode tty ntsec

Start a cygwin bash console

Configure SSH

# ssh-host-config
    Should privilege separation be used? (yes/no) no
    Do you want to install sshd as service? (yes/no) yes

Now you have a choice of the service being automatically or manually started

Automatically Started: 
    # cygrunsrv -S sshd 
Manually Started:
    # net start sshd
    # net stop sshd


That’s it, very simple, heh ?

Enjoy
Loni - Just Loni

Advertisement