Configure SSH using CYGWIN on Windows 7

Steps: Make sure Open SSH and Open SSL packages installed in Cygwin.

 











Run,

chmod +r etc/passwd
chmod u+x etc/passwd

chmod +r etc/group
chmod u+x etc/group

chmod 755 /var
touch /var/log/sshd.log
chmod 664 /var/log/ssh.log

then,
Run
$ ssh-host-config

*** Query: Overwrite existing /etc/ssh_config file? (yes/no) yes
*** Info: Creating default /etc/ssh_config file
*** Query: Overwrite existing /etc/sshd_config file? (yes/no) yes
*** Info: Creating default /etc/sshd_config file
*** Info: Privilege separation is set to yes by default since OpenSSH 3.3.
*** Info: However, this requires a non-privileged account called 'sshd'.
*** Info: For more info on privilege separation read /usr/share/doc/openssh/READ ME.privsep.
*** Query: Should privilege separation be used? (yes/no) no
*** Info: Updating /etc/sshd_config file

*** Query: Do you want to install sshd as a service?
*** Query: (Say "no" if it is already installed as a service) (yes/no) yes
*** Query: Enter the value of CYGWIN for the daemon: [] ntsec tty
*** Info: On Windows Server 2003, Windows Vista, and above, the
*** Info: SYSTEM account cannot setuid to other users -- a capability
*** Info: sshd requires.  You need to have or to create a privileged
*** Info: account.  This script will help you do so.


*** Info: This script plans to use 'cyg_server'.
*** Info: 'cyg_server' will only be used by registered services.
*** Query: Do you want to use a different name? (yes/no) no
*** Please enter the password for user 'cyg_server': {Hit Enter}
*** Reenter: {Hit Enter}


*** Info: The sshd service has been installed under the 'hadoop'
*** Info: account.  To start the service now, call `net start sshd' or
*** Info: `cygrunsrv -S sshd'.  Otherwise, it will start automatically
*** Info: after the next reboot.

*** Info: Host configuration finished. Have fun!


Troubleshooting:

If you u found any permission related issues try following below steps and run ssh-host-config again.

1. Run
$ chmod 777 /var/run

2. Create new user using control panel->user accounts->add new user (must be having administrator privilages)
Goto compmgmt.msc->users and groups->groups->Click properties under adminstrators ->add newly create user->click ok.

3. To get all local users and groups in sync run below commands,

mkpasswd -l > /etc/passwd 
mkgroup -l > /etc/group

4.Run ssh-host-config again.







Comments