LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-01-2003, 05:38 AM   #1
Mydal
LQ Newbie
 
Registered: Jan 2003
Posts: 2

Rep: Reputation: 0
setting up iptables


G'day

I'm new to linux and have a linux server that I want to setup with iptables. My server is in one country while I am in another. I want to secure it for my PC and the DC to have shell access only. It is a web server so the hosted web pages also need to be able to be viewed. It is shell access that I want to limit.

I have read some tutorials and am confused with the amount of info out there. Any help would be an advantage.

Later
Mydal
 
Old 01-01-2003, 05:45 AM   #2
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
I don't quite understand what you are saying. You want to set up a web server and nothing else right? You want shell access but you want to restrict it?
 
Old 01-01-2003, 09:05 AM   #3
Mydal
LQ Newbie
 
Registered: Jan 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Ok... sorry 'bout not being clear.
I have a server which has a number of sites on it.
I want to set it up so as to set the ip addresses which will be able to login to root, ie. admin and the dc. Any IP's other than those listed will not be able to gain root access.
Otherwise the server is running as a normal web server, with sites on it which are viewable by all and sundry in the usual way of web sites.

So, any helpful hints or links you have about setting up IP tables which could help out would be appreciated, as I don't really want to lock everyone out whilst i learn by trial and error (not in this instance, anyhow!)

Thanks
 
Old 01-03-2003, 02:59 PM   #4
jrmann1999
Member
 
Registered: Feb 2001
Location: Texas
Distribution: Slackware, Mandrake, LFS
Posts: 306

Rep: Reputation: 30
if the IP addresses are static this is trivially easy:

iptables -A INPUT -p tcp --dport 22 -s <ip#1> -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -s <ip#2> -j ACCEPT
.... (continue as needed for all IP's) ....
#iptables -A INPUT -p tcp --dport 22 -s <ip>/<mask> -j ACCEPT
#above is alternative to allow a whole range
iptables -A INPUT -p tcp --dport 22 -j DROP

iptables will then proceed to try and match line by line a given IP connecting to port 22(ssh port) and deny it if it's not allowed explicitly.


repeat the same for port 80 if needed to filter html traffic...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
setting iptables bijuhpd Linux - Newbie 4 03-17-2005 12:24 PM
Firewall setting up via iptables not able to get out countcobolt Linux - Networking 1 01-15-2004 06:43 PM
Help!!! Setting up a firewall using IPTables seidren Linux - Networking 2 08-20-2003 02:27 PM
Setting Up Iptables for NAT Chijtska Linux - Networking 1 02-13-2002 06:06 PM
Setting up DMZ with iptables.... ghost-ils Linux - Networking 0 09-09-2001 07:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:43 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