Saturday, February 16, 2013

0 Use Cygwin create SSHD service on Windows

 

Software

 

Install cygwin

The installation is straight forward. The important thing is to make sure to select the openssh and openssl package during the installation.

 

Update cygwin.bat

update the C:\cygwin\Cygwin.bat with below content.

@echo off
 
C:
chdir C:\cygwin\bin
set CYGWIN=binmode ntsec
bash --login -i

 

create sshd service

 

ssh-host-config

image

After the sshd service is created, startup the service

image

Now, after the sshd service is started, we can test the ssh.

Fix the permission denied error

 

When I am testing the ssh from linux to windows, I get the permission denied error even the password is correct.

image

The issue is the cygwin does not write the password into the /etc/password properly. We have to manually  run the mkpasswd.exe again.

mkpasswd.exe -l > /etc/passwd

image

After that, I can ssh from linux to windows successfully.

image

 

Reference

0 comments:

Post a Comment

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates