Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Typically what I do is:
cd /etc/sysconfig
cp -p iptables iptables.YYYYMMDD - This saves the current file to a date stamped copy.
iptables-save >iptables-save.YYMMDD - This saves the rules currently in memory to a date stamped copy.
I then make any changes to iptables desired then run:
iptables-save >iptables
I've never had an issue overwriting /etc/sysconfig/iptables so I'm not sure why you do unless you're not running as root or unless there is something odd about permissions or use on your system which is why I ask for the above output.
Typically what I do is:
cd /etc/sysconfig
cp -p iptables iptables.YYYYMMDD - This saves the current file to a date stamped copy.
iptables-save >iptables-save.YYMMDD - This saves the rules currently in memory to a date stamped copy.
I then make any changes to iptables desired then run:
iptables-save >iptables
I've never had an issue overwriting /etc/sysconfig/iptables so I'm not sure why you do unless you're not running as root or unless there is something odd about permissions or use on your system which is why I ask for the above output.
What does "ls -l /etc/sysconfig/iptables" output?-rw------- 1 root root 3897 Apr 26 14:42 /etc/sysconfig/iptables
What does "ls -ld /etc/sysconfig" output?drwxr-xr-x 10 root root 4096 May 9 16:51 /etc/sysconfig
What does "ls -ld /etc" output?drwxr-xr-x 102 root root 12288 May 7 11:45 /etc
What does "lsof /etc/sysconfig/iptables" output?nothing
I don't see anything there that would prevent root from writing to iptables but you didn't answer the question I asked first: Are you logged in as root?
Type "who am i" and show output.
Type "whoami" and show output.
Also do NOT put "pls help" in your forum posts - if you're posting here it is understood as a request for assistance and adding the request for help annoys many people especially if you repeat it. Putting it at the end of your last post seems to imply my prior post was not an attempt to "help".
I don't see anything there that would prevent root from writing to iptables but you didn't answer the question I asked first: Are you logged in as root?
Type "who am i" and show output.
Type "whoami" and show output.
Also do NOT put "pls help" in your forum posts - if you're posting here it is understood as a request for assistance and adding the request for help annoys many people especially if you repeat it. Putting it at the end of your last post seems to imply my prior post was not an attempt to "help".
yes i logged in as root....
Type "who am i" and show output srini pts/3 2012-05-10 09:38 (192.168.45.7)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.