安装 cygwin sshd 服务遇到的问题

我遇到的问题,安装好cygwin后并配置服务,启动服务时遇到如下错误

windows服务管理界面启动弹出窗口:
    服务启动后停止了,没有工作什么之类,类似性能日志。  
  
cygwin客户端:
$ cygrunsrv --start sshd:  
  cygrunsrv: Error starting a service: QueryServiceStatus: Win32  error  1062: The service has not been started. 

  

后来查看了日志  /var/log/sshd.log 日志报错翻译:权限拒绝,无sshd这个用户。

 

所有我又配置了一次sshd服务

1. cmd --> sc delete sshd

2. cygwin --> ssh-host-config

提示覆盖原服务配置 全部yes(如以前没配置则不会显示)

should pirvilege separation be used? yes(很多地方写no)

然后创建本地账户 sshd yes

insatll sshd as a server  yes

deamon:[] 直接回车

Hava Fun!

然后启动成功了,这个错误忽悠我N天,以后记得查看日志。

下面文章给我很大启示,关键是给我查看日志的地方。

 

======================================================================

I am trying to setup git on windows box - and so far all appears to be working ... except this :)

 

net start shhd - gets the error NETHELPSMG 3534

 

When I type

 

cygrunsrv --start sshd I get - QueryServiceStatus: Win32 error 1062

 

You can find here the steps taken to solve this issue under cygwin:

 

        Look at /var/log/sshd.log:

        /var/empty must be owned by root and not group or world-writable.

 

        Adjust mode of /var/empty and attempt to start sshd:

 

$ chmod 700 /var/empty

 

        Change owner of /var/empty:

 

$ chown root empty/

chown: invalid user: `root'

 

        root is not a valid user name. Make an educated guess and try again:

 

$ chown "Service Account Name" var/empty

 

$ ll -d empty/

drwx------+ 2 SYSTEM None 0 Feb 17 14:30 empty//

 

Then:

 

$ net start sshd

The CYGWIN sshd service is starting.

The CYGWIN sshd service was started successfully.

 

Regarding the 1062 error, it reports that the windows service has not been started.

 

$ cygrunsrv --start sshd

cygrunsrv: Error starting a service: QueryServiceStatus: Win32

error 1062:

The service has not been started.

 

..

 

$ net start sshd

The CYGWIN sshd service is starting.

The CYGWIN sshd service could not be started. # only if the previous section was not solved

 

Note: be aware that:

 

    some anti-virus might interfere with that service.

    See this thread.

    older version of cygwin1.dll might also interfere with the process.

    See that thread.

 

看到的原文地址:http://blog.sina.com.cn/s/blog_6f381c1f01012eg0.html

转载于:https://www.cnblogs.com/tiga/archive/2012/11/16/2772643.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值