Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2397633
  • 博文数量: 328
  • 博客积分: 4302
  • 博客等级: 上校
  • 技术积分: 5486
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-01 11:14
个人简介

悲剧,绝对的悲剧,悲剧中的悲剧。

文章分类

全部博文(328)

文章存档

2017年(6)

2016年(18)

2015年(28)

2014年(73)

2013年(62)

2012年(58)

2011年(55)

2010年(28)

分类: WINDOWS

2013-10-16 13:37:05

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 用户组

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