LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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
 
LinkBack Search this Thread
Old 12-10-2006, 01:43 PM   #1
gruntwerk
Member
 
Registered: Dec 2003
Location: PA
Distribution: fc9
Posts: 89

Rep: Reputation: 15
how to limit ssh connections to my isp only


I cant help but think that there is an easy way to do this.
I want to limit ssh (*and vnc*) connections to those originating from my isp only. I would like the packets from other sources to be dropped.

Did I miss something in the config files? Is there a simple iptables rule for this? Or is there something simple I can put in hosts.allow?
tanks
rog
 
Old 12-10-2006, 01:52 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,835

Rep: Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118
depends what you mean by "my isp".... you mean the various world routable networks that they own??
 
Old 12-10-2006, 02:01 PM   #3
gruntwerk
Member
 
Registered: Dec 2003
Location: PA
Distribution: fc9
Posts: 89

Original Poster
Rep: Reputation: 15
yes, I mean connections from people who use myisp.net, nobody else.
 
Old 12-10-2006, 02:47 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,835

Rep: Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118
well you need to just identify what those potential networks are then. once you have those subnets, e.g. 217.120.34.0/24 then that subnet just becomes a parameter to the -s option in iptables.
 
Old 12-12-2006, 12:40 PM   #5
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 30
And for knowing the potential subnets belonging to my isp... I'd rather make a call to my isp & ask them about their network.
 
Old 12-12-2006, 02:43 PM   #6
gruntwerk
Member
 
Registered: Dec 2003
Location: PA
Distribution: fc9
Posts: 89

Original Poster
Rep: Reputation: 15
hosts.allow seems to be doing the trick for SSH. The major problem which was people trying to logon using dictionaries. now they get connection refused and go on to the next box. Maybe its time to look into TightVNC?
 
Old 12-12-2006, 04:18 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,835

Rep: Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118
the next box? how many do you have? there are certainly plenty of ways to guard against dictionary attacks. say if you have 10 logon failures within 5 minutes, block connections from that source address for 1 hour etc... all simple iptables rules really, if you check the iptables howto.

Also in general i'd advise against using hosts.allow (tcpwrappers) as the front line of security. whilst it's very useful and should be used where possible, having a more generic iptables firewall sitting in fornt of that stopping most sources ever even being allowed to open a connection to the server is generally preferable.

and i'm really not sure how tightvnc will help you here... i'd be much much more comfortable exposing ssh to the net than vnc...
 
Old 12-12-2006, 05:30 PM   #8
gruntwerk
Member
 
Registered: Dec 2003
Location: PA
Distribution: fc9
Posts: 89

Original Poster
Rep: Reputation: 15
Agreed iptables can and WILL do a lot, when I get around to it.

But, the only one wanting to connect to this particular box should be on my isp, seemed like that would be a quick and easy way to ignore the rest if i could just specify ignore all but myisp.net, which hosts.allow does.

vnc however doesnt use tcpwrappers, so ill have to get down and dirty with thatone or force vnc to go thru ssh.

Last edited by gruntwerk; 12-12-2006 at 05:37 PM.
 
Old 12-13-2006, 02:05 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,835

Rep: Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118Reputation: 1118
well i'd certainly recommend an ssh tunnel for that, because if nothing else there is only a single service (ssh) being exposed to the internet. so you can enable whatever insecure services you wish and all the while you only connect via an ssh tunnel you'll just just as secure as if they weren't running.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a way to limit TCP connections ewerta Linux - Networking 1 07-25-2005 03:54 PM
limit connections Smokey Slackware 1 10-13-2004 02:22 AM
Limit on Telnet Connections ** Urgent powerhouse Linux - Software 3 03-31-2004 07:24 AM
Limit connections per source IP addr uniQ Linux - Security 4 01-13-2004 11:49 PM
limit cocurrent connections in ipchains milind Linux - Networking 3 09-24-2001 07:13 AM


All times are GMT -5. The time now is 01:27 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration