最近在修改SSH的配置文件时出现个莫名其妙的问题,重启系统后无法连接上SSH。在VPS备用SSH中执行命令:Service sshd start 提示以下错误:

@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
PermissiONs 0775 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 0775 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 2. Could not load host key
sshd: no hostkeys available — exiting.

参考了下相关资料,可能是文件权限的问题,解决方法如下
#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

OK,问题解决。


评论专区
  • 昵 称必填
  • 邮 箱必填
  • 网 址选填
◎已有 0 人评论
作者介绍
吕布

吕布

负责所有栏目的编辑工作。
80vps henghost
budgetvm sugarhosts

分享:

支付宝

微信