2008年5月18日星期日

How to run the OpenSSH SSHD server on Windows using Cygwin

How to run the OpenSSH SSHD server on Windows using Cygwin
How to setup automatic login with ssh without a password

1. Install the following Cygwin packages (rerun setup if necessary -- you can add packages after you have already installed Cygwin).

   Admin --> cygrunsrv
   Net --> openssh

2. Open a new bash shell window and run the SSH configure stuff.

   ssh-host-config

   注意,在配置过程中,UsePrivilegeSeparation选择no。这样,sshd不会启动单独的线程,后面我们就有机会手工修改sshd_config。

3. Now you are ready to start the service.

   cygrunsrv -S sshd

   stop
   
   cygrunsrv -E sshd

4. Generate your key pair using the following command:
   $ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa

5. $ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

6. 修改/etc/sshd_config,使sshd能够使用到上一步生成的authorized_keys
   AuthorizedKeysFile    .ssh/authorized_keys

tips:
如何查看sshd服务器端的log信息
1. 修改/etc/sshd_config,打开LogLevel,并改为DEBUG。
2. 日志要通过administrative tools->Event Viewer查看,属于application log。

ssh -v 查看登录过程中的debug信息

http://www.noah.org/wiki/Sshd_on_Windows
http://magicmonster.com/kb/net/ssh/auto_login.html

没有评论: