cygwin安装sshd服务(win7)Error installing a service: OpenSCManager: Win32 error 5:

转载 2013年12月04日 14:55:56
  1. Error installing a service: OpenSCManager: Win32 error 5:  
          出现这个问题的解决办法:win7系统管理员运行Cygwin软件




正确的过程为:

  1. sony@sony-VAIO~ $ ssh-host-config
  2. *** Info: Generating /etc/ssh_host_key
  3. *** Info: Generating /etc/ssh_host_rsa_key
  4. *** Info: Generating /etc/ssh_host_dsa_key
  5. *** Info: Generating /etc/ssh_host_ecdsa_key
  6. *** Info: Creating default /etc/ssh_config file
  7. *** Info: Creating default /etc/sshd_config file
  8. *** Info: Privilege separation is set to yes by default since OpenSSH 3.3.
  9. *** Info: However, this requires a non-privileged account called 'sshd'.
  10. *** Info: For more info on privilege separation read /usr/share/doc/openssh/READ
  11. ME.privsep.
  12. *** Query: Should privilege separation be used? (yes/no) no
  13. *** Info: Updating /etc/sshd_config file
  14. *** Query: Do you want to install sshd as a service?
  15. *** Query: (Say "no" if it is already installed as a service) (yes/no) yes
  16. *** Query: Enter the value of CYGWIN for the daemon: netsec] netsec
  17. *** Info: On Windows Server 2003, Windows Vista, and above, the
  18. *** Info: SYSTEM account cannot setuid to other users -- a capability
  19. *** Info: sshd requires. You need to have or to create a privileged
  20. *** Info: account. This script will help you do so.
  21. *** Info: You appear to be running Windows XP 64bit, Windows 2003 Server,
  22. *** Info: or later. On these systems, it's not possible to use the LocalSystem
  23. *** Info: account for services that can change the user id without an
  24. *** Info: explicit password (such as passwordless logins [e.g. public key
  25. *** Info: authentication] via sshd).
  26. *** Info: If you want to enable that functionality, it's required to create
  27. *** Info: a new account with special privileges (unless a similar account
  28. *** Info: already exists). This account is then used to run these special
  29. *** Info: servers.
  30. *** Info: Note that creating a new user requires that the current account
  31. *** Info: have Administrator privileges itself.
  32. *** Info: No privileged account could be found.
  33. *** Info: This script plans to use 'cyg_server'.
  34. *** Info: 'cyg_server' will only be used by registered services.
  35. *** Query: Do you want to use a different name? (yes/no) yes
  36. *** Query: Enter the new user name: sony
  37. *** Query: Reenter: sony
  38. *** Warning: Privileged account 'sony' was specified,
  39. *** Warning: but it does not have the necessary privileges.
  40. *** Warning: Continuing, but will probably use a different account.
  41. *** Warning: The specified account 'sony' does not have the
  42. *** Warning: required permissions or group memberships. This may
  43. *** Warning: cause problems if not corrected; continuing...
  44. *** Query: Please enter the password for user 'sony':
  45. *** Query: Reenter:
  46. *** Info: The sshd service has been installed under the 'sony'
  47. *** Info: account. To start the service now, call `net start sshd' or
  48. *** Info: `cygrunsrv -S sshd'. Otherwise, it will start automatically
  49. *** Info: after the next reboot.
  50. *** Info: Host configuration finished. Have fun!

$ net start sshd
发生系统错误 1069 --- 表示由于登录失败而无法启动服务

解决方法:在cmd中输入services.msc即可打开windows的服务,在服务中把密码改对就可以了。
(在上面配置ssh的过程中我的用户名是:sony 密码是:123456)

sshd服务装成功如下:

  1. sony@sony-VAIO ~ $ net start sshd
  2. CYGWIN sshd 服务正在启动 .
  3. CYGWIN sshd 服务已经启动成功

接下来是配置无密码登陆:

  1. sony@sony-VAIO ~ $ ssh-keygen -t rsa
  2. Generating public/private rsa key pair.
  3. Enter file in which to save the key (/home/sony/.ssh/id_rsa):
  4. Created directory '/home/sony/.ssh'.
  5. Enter passphrase (empty for no passphrase):
  6. Enter same passphrase again:
  7. Your identification has been saved in /home/sony/.ssh/id_rsa.
  8. Your public key has been saved in /home/sony/.ssh/id_rsa.pub.
  9. The key fingerprint is:
  10. e8:38:5e:e3:bb:cf:76:03:61:5f:f2:68:ed:a3:49:db sony@sony-VAIO
  11. The key's randomart image is:
  12. +--[ RSA 2048]----+
  13. | |
  14. | |
  15. | |
  16. | .o . . |
  17. | ..So * |
  18. | o . + o |
  19. | o + o.. |
  20. | . + o..o+o |
  21. | . +=o.+oE. |
  22. +-----------------+
  23. sony@sony-VAIO ~ $ cd .ssh/
  24. sony@sony-VAIO ~/.ssh $ ls
  25. id_rsa id_rsa.pub
  26. sony@sony-VAIO ~/.ssh $ cp id_rsa.pub authorized_keys
  27. sony@sony-VAIO ~/.ssh $ ls
  28. authorized_keys id_rsa id_rsa.pub

验证如下:

  1. sony@sony-VAIO ~/.ssh $ ssh localhost
  2. The authenticity of host 'localhost (::1)' can't be established.
  3. ECDSA key fingerprint is 5f:21:b1:24:80:92:f6:af:3e:e3:a8:f9:cb:a4:4f:ec.
  4. Are you sure you want to continue connecting (yes/no)? yes
  5. Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
  6. sony@sony-VAIO ~ $ who
  7. sony tty0 2011-11-25 15:42 (::1)  

python 4-2 如何判断字符串a是否以字符串b开头或结尾str.startswith/os.stat(filename)/stat.S_IRWXU

python 4-2 如何判断字符串a是否以字符串b开头或结尾在当前目录下查找以sh或者以py结尾的文件名,并且将其权限修改成777import os,statfor filename in [ na...

Linux系统设备(device)的major和minor number

Linux系的/dev目录下面的的设备文件是用来表示外设的,如/dev/sda1表示第一块硬盘的第一个分区。但是这个/dev/sda1仅仅是方便用户观察,linux内核中表示不同的设备是通过major...

win7+cocos2d-x2.1.3+NDK9r+cygwin+adt-bundle-windows-x86-20130729由VS2010WIN32移植到android

先吐槽一下,MB自己总以为当设计到一些高级NB算法的时候,就是纠结的时候,没想到一个项目移植花了老子将近一天的时间,才搞定,很久没记录心得了,今天就破例写写那些扯蛋的移植是碰到的问题。   环境就不说...

win7硬盘安装Ubuntu12.04 64位时显示Error 15: File not found.

安装Ubuntu12.04 -64位时,用EasyBCD建好引导文件重启电脑后出现如下错误: Error 15: File not found 原因一个是安装文件所在盘符不对,另一个是文件名。Ubun...

win7 下安装vb6.0(Error accessing the OLE registry)

文章(Install VB6 on Windows 7)转自 http://www.fortypoundhead.com/showcontent.asp?artid=20502 前段时间在win7旗...

WIN32_ERROR code

  • 2012年07月25日 17:39
  • 166KB
  • 下载

VC6.0 Could not execute: invalid directory (Win32 error 267)

Could not execute: invalid directory (Win32 error 267)   (2011-09-07 11:37:18) 转载▼ 标...

错误 1 error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value

错误 1 error C1189: #error :  This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value...
  • hfmeet
  • hfmeet
  • 2014年08月06日 16:06
  • 681

fatal error C1083: 无法打开源文件:“WIN32”: No such file or directory(VS)的解决方法

fatal error C1083: 无法打开源文件:“WIN32”: No such file or directory(VS)的解决方法...

VS2010编译错: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403...的解决方法

VS2010编译错: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403...的解决方法 ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:cygwin安装sshd服务(win7)Error installing a service: OpenSCManager: Win32 error 5:
举报原因:
原因补充:

(最多只允许输入30个字)