LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-05-2003, 08:13 AM   #1
rajeshdorai
LQ Newbie
 
Registered: Sep 2003
Posts: 20

Rep: Reputation: 0
Selective login to Linux server.


Hello,

I would like to setup my Linux server such that I only allow logins from certain machines (based on their IP). I was wondering if this is, first of all, possible at all. Further, if it is possible, could anyone point me towards how to do this? Any help is greatly appreciated.

Thanks,
RD.
 
Old 09-05-2003, 08:31 AM   #2
gundelgauk
Member
 
Registered: Jul 2003
Distribution: Gentoo
Posts: 168

Rep: Reputation: 30
Greetings!


To only allow specified IP adresses to access your server you have to first block all incoming connections:
iptables -P INPUT DROP

Then for example in order to allow a client using the IP 192.168.0.14 to access your FTP service, you will have to set up rules like the following:
iptables -A INPUT -i eth0 -p tcp -s 192.168.0.14 --dport 21 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -s 192.168.0.14 --dport 20 -j ACCEPT

This is assuming the client is in your local LAN and your according interface is eth0. To allow clients to connect via internet you need to change -i eth0 to your internet interface (eg ppp0) and of course the source IP.

I strongly suggest you the manual pages for iptables and the iptables HOWTO for more options!


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
X selective translucency? shishimo Linux - Software 1 06-22-2005 07:31 PM
how to login into a linux server from a Linux/Windows client Ninja_212 Linux - Networking 7 04-06-2005 01:25 AM
WinXP user can not login LINUX File Server. thinhpham Linux - Networking 3 12-28-2004 10:24 PM
Selective startup LemonSHARK Red Hat 1 03-02-2004 05:25 PM
login server for multiple Linux boxes? freddieB Linux - Networking 1 11-26-2001 10:20 AM

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

All times are GMT -5. The time now is 04:38 PM.

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