Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 '10 at 22:15

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
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 '10 at 22:43

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.