Installing ssh from Cygwin on a Windows Server

Install cygwin from http://sources.redhat.com/cygwin/

I like ftp://ftp.sunsite.utk.edu as a mirror site

when you get to the package manager, goto net, and choose to install ssh, or openssh, or whatever they call it.

If you want to use RSA encryption so you can automatically log into other sites:
ssh-keygen -t rsa

I choose an empty pass phrase, so I can run bash script without intervention.

configure the host
/usr/bin/ssh-host-config  -d

I choose to overwrite the existing files and install as a service.

start
my computer
right click
manage
Services and Applications
services
double click CYGWIN sshd
click 
msconfig
compnent services
set startup type to automatic
click start to start running

to test it:
ssh USERNAME@127.0.0.1  where USERNAME is your current username


Making sure the server doesn't shut down before you remote into it :

Start Right Click  My Computer  Properties  Hardware DeviceManager  Network Adaptors 
right click on your nic properties  powermanagement  uncheck "Allow the computer to turn off this device to save power"

right click on the desk top
properties
screen saver
power
set Turn off hard disk to Never
set system standby to never

Reconfiguring Priviliges so that nmake Will Work from Bash

or

How to start Cygwin SSHD service with administrative priviliges

There are two ways you can do this
1.) Add a user specifically for the sshd service
or
2.) Use your current user (must have administrative rights)

The easiest way without creating any extra users is to just use your current user which probably already has administrative rights by default, to do this there are a few things you must do first.

  1. Stop the sshd service (Right click on My Computer -> Manage -> Services -> Right click on CYGWIN SSHD and click stop)
  2. Change the services local systems user to userid in Computer Management (Right click on CYGWIN SSHD and click Properties, click the "Logon Tab" click "This account", and then browse, type in your user and click "Check Names" and then OK)
  3. Goto Local Security Settings on the local machine (Start -> Run -> secpol.msc)
  4. Add your current user to the following keys (Right click on the key and click properties, click add user or group, simply type in the current user and click "Check Names" and click OK):
    1. Adjust memory quotas for a process
    2. Create a token object
    3. Log on as a service
    4. Replace a process level token
  5. Do the following commands in Cygwin replacing "userid" with your current user:
    $ chown userid /var/log/sshd.log
    $ chown -R userid /var/empty
    $ chown userid /etc/ssh*
  1. In Cygwin, type "net start sshd"
  2. If step 6 completed without errors, your sshd service should now be functioning with administrative rights, to verify this, goto task manager by right clicking on the task bar and clicking task manager, goto the Processes tab, for "sshd.exe" it should be ran by your current user.
  3. To verify that your current user has administrative rights, right click on My Computer -> Manage -> Local Users and Groups -> Users, right click on your user and click properties and goto the "Member Of" tab, if "Administrators" is listed there your user has administrative rights.