Re: SSH allow only form selected IP'

James Turnbull <[email protected]> Sat, 14 Aug 2004 20:54:21 +1000
Newsgroups gmane.linux.configuration,gmane.linux.admin
Message-ID <[email protected]>
Kev wrote:

>hi,
>
>i have a redhat enterprise 3 linux box, how can i configure SSH demon
>only to allow SSH connections only form selected IP's ? 
>
>i have 3 IP rangers that i need to allow, how can i do this ?
>
>thanks a lot
>Kev
>
>
>------- 
>Web Hosting at a cheap price, starting at $1 per month with your own domain, .COM, .NET, .LK, .ORG etc..
>PHP, CGI, Perl, MySQL, Cpanel 9, POP3, POP3s, SMTP, IMAP, FTP,
>http://www.orbitsl.net
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-config" in
>the body of a message to [email protected]
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>  
>
Use your firewall rules.  Something like:

iptables -A INPUT -p tcp -m state --state NEW,ESTABLISHED -s 
192.168.0.0/24 --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -d 
192.168.0.0/24 --sport 22 -j ACCEPT

Where 192.168.0.0/24 is the range you are allowing.

Regards

James
smime.p7s (application/x-pkcs7-signature, 2.7 KB) - not displayed