1.首先确认防火墙关闭
rcSuSEfirewall2 status
Checking the status of SuSEfirewall2 unused
2、检查/etc/ssh/sshd_config文件
若需要修改要重启生效,service sshd restart。
3、检查ssh是否启动
service sshd status
发现没有启动
service sshd start 提示:
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 2. Could not load host key
sshd: no hostkeys available -- exiting.
[FAILED]
4、就需要检查一下/etc/ssh/目录下文件的权限
发现/etc/ssh/下所有文件权限均为777,此时需要做如下修改
#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
\(^o^)/~ 启动正常了。
本文指导如何排查并解决SSH服务未启动的问题,包括检查防火墙状态、验证/etc/ssh/sshd_config文件配置、确保ssh服务启动,以及修复/etc/ssh/目录下文件权限不当导致的错误。
1435

被折叠的 条评论
为什么被折叠?



