SSH server on Windows Vista or Windows 7
- Right-click Cygwin icon and select Run as administrator
- Execute...
ssh-host-config
Say yes to all yes/no questions except for when it asks to use different user for registered services other than 'cyg_server'.
Enter a user that has Administrative privileges and a password.
- Edit /etc/hosts.allow and insert...
ALL: 127.0.0.1/32 : allow
ALL: [::1]/128: allow- Go to Control Panel ... Windows Firewall and open inbound TCP port 22. Optional?
- Start ssh server
cygrunsrv -R sshd
...or...
net start sshd
- Log on as a regular user and run...
ssh-user-config (Answer questions as appropriate to situation)
Note
You can run sshd as an existing user (Cygwin 1.7.1 and Windows 7)
Administrator is disabled on Windows 7 by default.
To enable run lusrmgr.msc.
For a regular user, such as Michael, to run sshd.
- Check existing permissions for Michael (in case you need to rollback):
editrights -l -u Michael
- Add additional privileges to allow sshd to run properly:
editrights.exe -a SeAssignPrimaryTokenPrivilege -u Michael
editrights.exe -a SeCreateTokenPrivilege -u Michael
editrights.exe -a SeTcbPrivilege -u Michael
editrights.exe -a SeServiceLogonRight -u Michael- Run ssh-host-config (don't force the -y option)
ssh-host-config
- Answer yes to all questions making sure when it asks "Do to use a different name?", say "yes" (this question is different with the -y option)
- Enter desired username (Michael) and password when you are prompted. You should *not* see any warnings. If you do, you might not have set all privileges correctly
- If all goes well, start sshd:
net start sshd
Uninstall cygwin under Vista or Windows 7
(From previous attempted failed installations)
In Administrator shell
net stop sshd
cygrunsrv -R sshd
net userDelete any user listed like sshd or sshd_server.
The following syntax is to be used:
net user sshd /DELETE
rm -R /etc/ssh*
mkpasswd -cl > /etc/passwd
mkgroup --local > /etc/groupIn User shell...
cd ~
rm -R .ssh
Related
Install sshd on Windows Vista