Wednesday 7 December 2016

Can't SSH even with iptables stopped?

The scenario is :

  1. You try to ssh from server A (192.168.56.90) to a remove server B (192.168.56.95);
  2. Both server A and server B are within the same network segment. (This means no hardware firewall involved)

The error is:





Let find the reason, for simple, just stop the iptables on remote server B.

#service iptables stop





I use "telnet" to troubleshoot, still refused. Check /etc/hosts.deny and /etc/hosts.allow, no findings.

Let's check sshd service on remote server B.





This is a low-level mistake, we just assume sshd is running. ok, we start sshd.

#service sshd start
#chkconfig sshd on

Actually we can tell the cause of the error from the error messages.

  • iptables port 22 not open, the error probably is "No route to host"
  • /etc/hosts.deny, error probably is "Connection closed by foreign host."

No comments:

Post a Comment