Cheug's Blog

当前位置:网站首页 / Server / 正文

SSH无法连接,查找排错

2018-09-18 / Server / 1102 次围观 / 0 次吐槽 /

适用于ssh无法连接,但能够ping通

1.查看端口是否正确

cat /etc/ssh/sshd_config

2.检查防火墙是否放行

/etc/init.d/iptables status

3.查看SSH状态

service sshd status

4.使用这两条命令查看ssh日志:

service sshd stop
/usr/sbin/sshd -d

出现debug1: Connection refused by tcp wrapper为服务器开启IP验证

编辑/etc/hosts.allow,加上 sshd:ALL 表示放行所有IP,然后重启SSH

出现/var/empty/sshd must be owned by root and not group or world-writable为权限问题

使用 ll /var/empty/ 查看

#正常的权限为这样
total 0
drwx--x--x. 2 root root 6 May 13 03:41 sshd

使用 chmod 711 /var/empty/sshd 修改权限


额 本文暂时没人评论 来添加一个吧

发表评论

必填

选填

选填

必填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Cheug's Blog

Copyright Cheug Rights Reserved.