Cygwin is best uninstalled from MS Windows by running the Cygwin setup.exe.
Here's the rough steps on how to do it according to the official FAQ.
- Stop and remove any cygrunsrv services
- Stop all Cygwin processes and unmount any filesystems mount with the mount command
- Delete the Cygwin root folder and all subfolders
- Delete the Cygwin shortcuts on the Desktop and Start Menu
- Remove cygwin binary path from your Windows search path, and delete the CYGWIN system variable
- Delete Software\Cygwin keys from registry.
Removing SSHD serviceEdit
For Windows XP:
To remove Cygwin sshd in the cleanest possible way:
cygrunsrv -E sshd
cygrunsrv -R sshd
delete the folder c:\cygwin and all its sub-folders
remove the Environment Variable 'CYGWIN'
edit the Environment path accordingly
Start...Run... regedit and delete these two registry trees
Go to Control Panel, Category View, Performance and Maintenance, Administrative Tools, Computer Management.or click Start...Run...compmgmt.msc delete the sshd user if it exists in the "System Tools" - "Local Users and Groups" - "Users" section.
Thanks to Dave Abrahams of Boost Consulting for the sshd user account deletion hint.