Cygwin Installation and Configuration

Installation

Download Cygwin. Choose installation location. It's best not to pick a directory path with spaces in it, then location for all the packages you will be downloading, and finally a mirror, preferably a location close to you. This is an important bit - package selection. If you're not familiar with linux just type in "openssh" in the search box and collapse the "Net" directory. Tick the [X] box in the "Bin" selection column and press next. Accept additional libraries that comes along with it. Also you can run Cygwin setup.exe again if you need additional packages. You won't be reinstalling the application, it will detect current packages on your system.

Preparation

Go to "My Computer/Properties/Advanced system settings/Environment Variables" and under "System Variables" press "New..." button. Type in variable name: CYGWIN and value: ntsec tty. Under "System Variables" select "Path" variable and press "Edit..." button. Append this line ";c:\cygwin\bin" (without quotation-marks) to the end of the existing string.

Configuration

As an administrator (or run Cygwin.bat console as an administrator: Cygwin.bat/Porperties/Compatibility/Run as Administrator) type these lines into the console:

When the script asks you about "privilege separation", answer yes. When the script asks to "create local user sshd," answer yes. When the script asks to "install sshd as a service," answer yes. When the script stops and asks you for "CYGWIN=" your answer is "ntsec tty". To start SSH service type in net start sshd and to stop it "net stop sshd".

Clean Uninstallation

In Administrator shell run:

Delete any user listed like sshd or sshd_server net user sshd /DELETE

In User shell:

Also if you're unable to delete cygwin\bin\cyglsa\cyglsa.dll navigate to "HKLM\SYSTEM\CurrentControlSet\Control\Lsa\Authentication Packages" and change its value from msv1_0 c:\cygwin\bin\cyglsa\cyglsa.dll to just msv1_0.

Tips and Tricks

Cygwin relies on Windows user database, to sync user information run:

Cygwin runs as privileged user and it shows on log in screen when computer starts. To hide it navigate to "HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon" in your registry (WinKey+R, type in regedit). Right-click on "Winlogon" in the tree directory (left panel) and select New > Key and name it "SpecialAccounts". Again in the tree directory, right-click on "SpecialAccounts" and create a new key titled "UserList". Now, in "UserList", right-click in the right panel and select New > DWORD (32-bit) Value. Name it "cyg_server". Double-clicking on the value name will allow you to modify the data contained within. Values 1 and 0 switches between visible and invisible.

References