【问题标题】:install sshd using cygwin使用 cygwin 安装 sshd
【发布时间】:2012-11-11 17:17:04
【问题描述】:

我想使用 cygwin 在 windows 中安装 sshd。但是当我启动 sshd 服务时,它说:

The CYGWIN sshd service is starting.
The CYGWIN sshd service could not be started.
The service did not report an error.
More help is available by typing NET HELPMSG 3534.

sshd.log 说:

Permissions 0660 for '/etc/ssh_host_dsa_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh_host_dsa_key
Could not load host key: /etc/ssh_host_dsa_key

那么怎么处理呢?

【问题讨论】:

    标签: cygwin sshd


    【解决方案1】:

    我的 /var/log/sshd.log 最后有这个:

    Disabling protocol version 2. Could not load host key
    sshd: no hostkeys available -- exiting.
    /var/empty must be owned by root and not group or world-writable.
    /var/empty must be owned by root and not group or world-writable.
    /var/empty must be owned by root and not group or world-writable.
    /var/empty must be owned by root and not group or world-writable.
    

    看着 /var 我看到了这个:

    $ ls /var -All
    total 0
    drwxrwxr-x+ 1 xxxx       None 0 Dec  8 15:59 cache
    drwxrwxr-x+ 1 cyg_server root 0 Dec  8 16:21 empty
    drwxrwxr-x+ 1 xxxx       None 0 Dec  8 15:58 lib
    drwxrwxrwx+ 1 xxxx       None 0 Dec  8 16:27 log
    drwxrwxrwx+ 1 xxxx       None 0 Dec  8 15:48 run
    drwxrwxrwt+ 1 xxxx       None 0 Dec  8 15:48 tmp
    

    所以我刚刚做了chmod 600 /var/empty 并修复了它!

    【讨论】:

      【解决方案2】:

      您需要确保只有 cyg_server 用户可以访问这些密钥。

      chown cyg_server /etc/ssh*
      chmod 600 /etc/ssh*
      

      这些命令就是这样做的,并且可以让您的 sshd 正确运行。

      【讨论】:

      • 我不确定如何访问 sshd.log 文件(cat /var/log/sshd.log 返回空白,甚至我的ls 也返回空白?),但我应用了您所说的两个命令,但仍然无法连接。有什么想法吗?
      • 好的,如果我 print /var/log/sshd.log 它返回以下内容:Unable to initialize device PRN
      • 希望其他人可以提供更多帮助...实际完成这项工作需要付出很多努力,而我只安装了一次 W7。您是否按照指南进行设置?
      • 是的,首先我关注了一个 Youtube 视频,然后开始在两个博客上,但没有成功。我的电脑有点旧;我星期一开始了一份新工作,并在他们为我提供新电脑时重试。
      猜你喜欢
      • 1970-01-01
      • 2015-09-13
      • 2011-10-27
      • 1970-01-01
      • 1970-01-01
      • 2017-07-19
      • 2013-04-18
      • 2011-08-03
      • 1970-01-01
      相关资源
      最近更新 更多