1

I am having an issue where I can access a server remotely via SSH but if I send the reboot command. Once the server reboots I get a timeout when I try to relogin. The only way to fix the problem is to issue the following commands "service iptables restart" and "service sshd restart" from the physical server commandline. I use a non-standard port to access the server via SSH. The firewall is set to allow access on that port.

Can someone tell why this is happening?

1
  • Are you redirecting your "non-standard port" to port 22 using iptables, or is ssh listening directly on the "non-standard port"?
    – Weboide
    Jul 4, 2010 at 22:15

2 Answers 2

1

You may have another firewall installed with its own initscript, and restarting the iptables service wipes the rules it adds and puts its own in place. The output of iptables -L after rebooting as well as a listing of the contents of /etc/init.d can confirm this.

1
  • You are correct! I recently made many changes to my network (hardware related) and I had forgot that I had Advanced Policy Firewall (apf) installed on the system. A quick change of port numbers in the conf.apf for IG_TCP_CPORTS and IG_UDP_CPORTS and all worked again when rebooting from a remote system.
    – ricbax
    Jul 4, 2010 at 22:43
1

When you do either of the "service servicename restart", does one (or both) produce output like the following:

Stopping sshd:                                             [FAILED]
Starting sshd:                                             [  OK  ]

If either sshd, or iptables produce the "failed" then "ok" when you issue a restart, it isn't getting started from init. You can fix that with

sudo /sbin/chkconfig sshd on

or

sudo /sbin/chkconfig iptables on

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .