Re: Iptables: port 22 open only for my IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Khan wrote:
Hello,

I am total beginner to Linux and I'm trying to learn iptables basics. I would like to learn how to close all ports but 80, 20, and that ports 22 and 10000 will be open only to my IP address.

OK,

here is what I got so far:

# Accept local (192.168.5.0/24) SSH traffic
$IPT -A INPUT -m state -p tcp --dport 22 ! --state INVALID -s 192.168.5.0/24 -j ACCEPT
$IPT -A OUTPUT -m state -p tcp --sport 22 --state ESTABLISHED,RELATED -d 192.168.5.0/24 -j ACCEPT


That will allow all 192.168.5.* addresses to access port 22. How Can I have only:

192.168.5.3
and
192.168.5.4

to access my 22 port. Tutorial I used is from:

http://linuxcourse.rutgers.edu/lessons/lecture9.html

TNX


-- redhat-list mailing list unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux