5

我想使用 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

那么如何处理呢?

4

2 回答 2

4

我的 /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,并且修复了它!

于 2013-12-09T14:48:44.797 回答
3

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

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

这些命令就是这样做的,并将允许您的 sshd 正确运行。

于 2013-03-08T21:22:57.060 回答