轉自: http://linux.chinaunix.net/bbs/archiver/?tid-680747.html

在linux 中,這一個問題讓我困擾了一段時間,在開機的時候也會出現這一段警示
然後像是更新和更改服務等等都會出現不明原因的錯誤

結果根據出現錯誤的一些關鍵字去搜尋解決方法
終於解決了這一個問題
以下是全文

Linux论坛 » 服务器应用 » ssh 问题请帮忙看一下!!!(很急)

2006-1-1 13:01 yyying

ssh 问题请帮忙看一下!!!(很急)

我起ssh时就出现这样的情况,我知道是我/etc设的权限问题,但是我改了几个小时还是没有改回来;
不知怎么改回来,希望大哥大姐们帮帮忙!!!谢谢拉!!!

/etc/init.d/sshd start
sshd@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/etc/ssh/ssh_host_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_key
Could not load host key: /etc/ssh/ssh_host_key
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/etc/ssh/ssh_host_rsa_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_rsa_key
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/etc/ssh/ssh_host_dsa_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 1. Could not load host key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.

2006-1-1 14:06 tanyear

回复 1yyying 的帖子

英语不好吧?

/etc/ssh/ssh_host_dsa_key这个文件的权限是777
需要改成others不能访问的权限。

我的这个文件系统默认权限
# ls -l /etc/ssh/ssh_host_dsa_key
-rw-------    1 root     root          668 Nov 15 04:21 /etc/ssh/ssh_host_dsa_key

你可以运行
chmod 600 /etc/ssh/ssh_host_dsa_key

2006-1-1 14:27 yyying

请问你的/etc的权限是什么啊!谢谢了!我现在可以用了;我还是要把/etc/权限改回来;

2006-1-2 10:26 Brain1127

/etc本身的默认权限应该是755其下子目录的权限需要具体视需要确定

2007-12-28 14:36 jcoop

#chmod 600 sshd_config ssh_host_dsa_key ssh_host_key ssh_host_rsa_key
#chmod 620 moduli
#chmod 644 ssh_config ssh_host_dsa_key.pub ssh_host_key.pub ssh_host_rsa_key.pub

#service sshd start

it`s ok!!

arrow
arrow
    全站熱搜

    Hentyduary 發表在 痞客邦 留言(0) 人氣()