Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6271603
  • 博文数量: 2759
  • 博客积分: 1021
  • 博客等级: 中士
  • 技术积分: 4091
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-11 14:14
文章分类

全部博文(2759)

文章存档

2019年(1)

2017年(84)

2016年(196)

2015年(204)

2014年(636)

2013年(1176)

2012年(463)

分类: WINDOWS

2013-10-17 09:01:35

原文地址:CYGWIN SSH Server 配置 作者:huaius

Cygwin是许多软件的集合,最初由Cygnus Solutions开发,用于各种版本的Microsoft Windows上,运行UNIX类系统。Cygwin的主要目的是通过重新编译,将POSIX系统(例如Linux、BSD,以及其他Unix系统)上的软件移植到Windows上。Cygwin移植工作在Windows NT、Windows 2000、Windows XP以及Windows Server 2003上比较好,在Windows 95和Windows 98上,相对差劲一些。Cygwin由Red Hat等负责维护。

安装了Cygwin之后,就可以像操作Unix那样的操作windows了,下面简要介绍一下如何在Cygwin上面配置SSH服务,使得可以从远程的机器上访问这台Windows。

1. 给文件授权,以完成sshd 服务的安装

chmod +r /etc/group
chmod +r /etc/passwd
chmod +rwx /var
 

2. 安装 sshd 服务


  1. $ ssh-host-config

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

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

  18. *** Info: You appear to be running Windows XP 64bit, Windows 2003 Server,
  19. *** Info: or later. On these systems, it's not possible to use the LocalSystem
  20. *** Info: account for services that can change the user id without an
  21. *** Info: explicit password (such as passwordless logins [e.g. public key
  22. *** Info: authentication] via sshd).

  23. *** Info: If you want to enable that functionality, it's required to create
  24. *** Info: a new account with special privileges (unless a similar account
  25. *** Info: already exists). This account is then used to run these special
  26. *** Info: servers.

  27. *** Info: Note that creating a new user requires that the current account
  28. *** Info: have Administrator privileges itself.

  29. *** Info: The following privileged accounts were found: 'cyg_server' .

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


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

  39. *** Info: Host configuration finished. Have

Administrator@backup ~
cygrunsrv.exe -S sshd  启动 SSH服务
 
安装完成后,系统服务中应该会有 CYGWIN sshd服务
一切正常,即可启动ssh服务. 登录的用户名是cyg_server, 密码是配置是设置的密码
 
 

3. 使用 windows 用户本地认证

 
mkpasswd -l > /etc/passwd  使用windows 用户的密码
mkgroup -l > /etc/group    使用windows 用户组

阅读(489) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~