LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-02-2006, 03:04 PM   #16
mr_furley
LQ Newbie
 
Registered: Jun 2006
Location: Houston, TX
Distribution: Fedora Core 3
Posts: 8

Original Poster
Rep: Reputation: 0

Thanks Jim.

I found that if used 'su -' instead of 'su' the 'iptables' command works fine. Why is this?

I ran
`iptables -I INPUT -p tcp --dport 22 -j ACCEPT'
again, and everything is working fine now. It seems as if after I reboot, the ip tables revert back to some default configuration. How can I fix it so that I don't have to rerun 'iptables...' every time I reboot?

Thanks!

D
 
Old 07-03-2006, 05:09 AM   #17
GTSI_Jim
LQ Newbie
 
Registered: Mar 2006
Posts: 3

Rep: Reputation: 0
As for the su - problem:

The hyphen has two effects: (1) it switches the current directory to the home directory of the new user (e.g., to /root in the case of the root user) and (2) it changes the environmental variables to those of the new user. That is, if the first argument to su is a hyphen, the current directory and environment will be changed to what would be expected if the new user had actually logged on to a new session (rather than just taking over an existing session).

Thus, administrators should generally use su as follows:

su -

An identical result is produced by adding the username root, i.e.,

su - root

As for the iptables issues:

iptables stores its config data from one boot to the other. Try doing an iptables -L after reboot to make sure. You probably need to issue an iptables-save after ou add your rule to ensure that this save happens.

Good Luck!

Jim
 
Old 07-03-2006, 09:00 AM   #18
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Rep: Reputation: 31
Another way to make sure your changes to iptables are saved is by using:
Code:
#/etc/init.d/iptables save
#/etc/init.d/iptables restart
#iptables -nvL | grep 22
This will save the current configuration of iptables to be the defualt one used whenever the machine is booted. Then it will restart the firewall. And finally look for any rules containing the value (22) (the default ssh port number) and report if any exist. It might result in additional lines if they also contain the value 22.

Good luck
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh connection from a Windows machine to a Linux machine pistachio Linux - Networking 1 08-30-2005 10:45 AM
how to open a dilog on local machine when i do ssh to remote machine fahad26 Programming 3 05-03-2005 07:39 PM
Unable to boot up the machine vr76413 Red Hat 2 09-23-2004 02:52 AM
Installed 2.6.7 kernel now<machine is s...l...o...w any ideas? joe83 Slackware 4 07-01-2004 11:34 AM
cant access my machine? any ideas? jsmith22046 Linux - Networking 5 10-24-2003 03:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration