Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ok, so I'm the kind of person that changes IPTABLES by editing /etc/sysconfig/iptables, what's the way to make them save so that someone accidentally using "iptables save" doesn't overwrite them?

share|improve this question
Don't give root privileges to idiots? Otherwise making the file read-only should work. – HBruijn May 8 '14 at 20:19
That works, I also did iptables-restore < /etc/sysconfig/iptables – Otto Bunge May 9 '14 at 5:43

HBruijn is right.

This is not a technical problem - it's a people problem. If those with root access are doing stupid things, then revoke their access.

share|improve this answer

Agreed. By putting rules in /etc/sysconfig/iptables you are basically saving them. IF there are other scripts on your system that would cause iptables-save to write rules there, you'll need to modify those scripts. If you have other admins or something, make it a policy that modifications to the firewall must be made in /etc/sysconfig/iptables. If you're "in charge" of the box then that should be your prerogative.

If users (!!) are editing the firewall and do the wrong thing, it's your duty to correct their actions or revoke their privileges.

share|improve this answer

Your Answer


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.