Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject:
PostPosted: Wed Mar 30, 2005 12:09 pm 
Offline
Junior Member

Joined: Fri Aug 20, 2004 10:32 am
Posts: 38
Well, I tried using some of the 200 ports, but those seemed to time out after a while too (not sure why).

So now I'm using the script mikegrb typed up, and it seems to be working, sort of.

Since I have to use PPPoE, I commented out the "iptables -A SSH_WHITELIST..." line. My understanding from the script is that it will allow 3 connections within a 60 second period, but it seems to only be allowing 1. Is there something that needs to be changed in the code above to allow up to 3 connections?

Also, is it safe to edit the 60 second thing? I am the only person who SSH's into my box, so wondering if it is OK if I extend the time frame to something longer, like 120 seconds or 300 seconds for even more added protection.

Thanks,
-Kevin


Top
   
 Post subject:
PostPosted: Wed Mar 30, 2005 5:55 pm 
Offline
Senior Newbie

Joined: Fri Apr 23, 2004 3:08 pm
Posts: 19
In addition to the above postings, you can also use /etc/hosts.allow and hosts.deny files for ssh.

What I have done in the past is allow .edu, .net, .org, .com. While this may still be considered "wide-open", it does block a lot of countries. Chances are, your legit users should be coming from one of the above anyways.

Now, I just use an IP address list since I only have a small number of users.

-John


Top
   
 Post subject:
PostPosted: Thu Mar 31, 2005 4:45 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
Internat wrote:
So im corious to know, if there is a way to makeip tables load certian rules on startup? cause i would like to implement the methods that were described in the link posted by mike

cheers
Nathan

Under Fedora the system will save the current table state at shutdown and reload it at bootup if you modify the config values in /etc/sysconfig/iptables-config

You can force a save of the current tables (in case teh server hangs) by /etc/init.d/iptables save

I dunno if the other Linux distro's do similar.

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
 Post subject: ULOG vs LOG
PostPosted: Thu Mar 31, 2005 5:22 pm 
Offline
Newbie

Joined: Mon Jan 10, 2005 1:31 pm
Posts: 4
Location: Canada
I changed ULOG to LOG, but I would like to limit the logging to a few per minute. I tried using -m limit --limit 2/minute, but it failed. Does the Linode kernel not have support for the limit module?


Top
   
 Post subject:
PostPosted: Fri Apr 08, 2005 11:21 am 
Offline
Senior Member
User avatar

Joined: Fri Aug 15, 2003 2:15 pm
Posts: 111
Website: http://fubegra.net/
I just noticed something when I rebuilt my system using Debian Sarge instead of Woody: if you want to disable password authentication (for public-key-only authentication), you need both PasswordAuthentication no and ChallengeResponseAuthentication no.

_________________
Bus error (passengers dumped)


Top
   
 Post subject:
PostPosted: Sun Apr 17, 2005 11:25 am 
Offline
Senior Member

Joined: Thu Apr 08, 2004 3:24 pm
Posts: 92
ICQ: 3765104
Website: http://www.unixfool.com
Yahoo Messenger: wigglit2001@yahoo.com
Location: VA
After continuing to see this thread dominate the top 10 threads, I decided to study up on implementing SSH keys for authentication. I generated keys for my freebsd box to access my linode, had success, and saw how simple it was to set up. I now have every single unix machine (5 machines) using SSH keys to authenticate to my linode. I'll eventually do the same thing with my linode, so it can run jobs and communicate with my unix boxes at home.

I'll eventually use iptables also, but this is solid enough (using a 512bit key) and SSH is the ONLY port open.


Top
   
 Post subject:
PostPosted: Sun Apr 17, 2005 5:08 pm 
Offline

Joined: Sun Apr 17, 2005 4:44 pm
Posts: 1
NecroBones wrote:
Another band-aid fix you can do if you have a very small number of users is to run sshd on a non-standard port. This of course is not a fix, but for 99.99% of the attacks out there, it'll be effective, since these brute-force approaches look for the low-hanging fruit, and they're not going to take the time to do a complete port scan on every IP. Not yet, anyway...


security through obscurity

Another precaution you can take is deny root login itself. This can be done by setting
PermitRootLogin to no in /etc/ssh/sshd_conf
And then using some arbitrary user to login to your linode for which you give very limited rights or none. The username for this user can be (ic87pz19fd for example) as cryptic as one of your password. Then su using this login.[/b]


Top
   
 Post subject:
PostPosted: Mon Apr 18, 2005 3:20 pm 
Offline
Senior Member

Joined: Sat Aug 30, 2003 6:35 am
Posts: 57
I use skey only logins (so anyone connecting without a valid skey is just disconnected, without the chance to enter anything).


Last edited by Ashen on Sun Apr 08, 2012 9:18 pm, edited 2 times in total.

Top
   
 Post subject:
PostPosted: Tue May 10, 2005 5:43 pm 
Offline
Senior Newbie
User avatar

Joined: Thu Feb 03, 2005 10:26 pm
Posts: 18
The iptables 'recent' module doesn't seem to be on my system.

Code:
iptables v1.2.11: Couldn't load match `recent':/lib/iptables/libipt_recent.so: cannot open shared object file: No such file or directory


Top
   
 Post subject:
PostPosted: Wed May 11, 2005 4:28 pm 
Offline
Senior Member
User avatar

Joined: Wed Mar 17, 2004 12:35 am
Posts: 118
Website: http://www.necrobones.com/
Location: Sterling, VA
strikesam wrote:
NecroBones wrote:
Another band-aid fix you can do if you have a very small number of users is to run sshd on a non-standard port. This of course is not a fix, but for 99.99% of the attacks out there, it'll be effective, since these brute-force approaches look for the low-hanging fruit, and they're not going to take the time to do a complete port scan on every IP. Not yet, anyway...


security through obscurity



Yes, I know, I thought I was clear about that. :)

_________________
----
Ed/Bones.


Top
   
 Post subject:
PostPosted: Thu May 12, 2005 7:29 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
astro wrote:
The iptables 'recent' module doesn't seem to be on my system.

Code:
iptables v1.2.11: Couldn't load match `recent':/lib/iptables/libipt_recent.so: cannot open shared object file: No such file or directory

CONFIG_IP_NF_MATCH_RECENT is set in both the Latest 2.4 and 2.6 kernels, and has been for quite some time now. This is a user-space problem.

-Chris


Top
   
 Post subject:
PostPosted: Thu May 12, 2005 8:24 pm 
Offline
Senior Newbie
User avatar

Joined: Thu Feb 03, 2005 10:26 pm
Posts: 18
My bad. I re-emerged the iptables package and it worked. Not sure what the deal was, though, because it was supposedly the same ebuild.

I added the "recent" feature to my iptables on my home computer the other day, and the number of these attempts dropped dramatically. Basically, only the first attempt will show in my logs, because the rest are dropped.


Top
   
 Post subject:
PostPosted: Thu May 12, 2005 8:40 pm 
Offline
Senior Newbie

Joined: Tue Apr 15, 2003 11:37 pm
Posts: 19
ICQ: 14880520
Website: http://www.tjfdesign.com
WLM: tfrevert@gmail.com
AOL: ext2904
Location: Wichita, KS
Quote:
So im corious to know, if there is a way to makeip tables load certian rules on startup? cause i would like to implement the methods that were described in the link posted by mike


I use the iptables-save command to save the config to a file and then use iptables-restore to load it on startup.

so...

iptables-save > /etc/myiptables.conf

then...

iptables-restore /etc/myiptables.conf


Top
   
 Post subject:
PostPosted: Fri May 13, 2005 11:23 am 
Offline
Senior Newbie

Joined: Wed Sep 22, 2004 11:53 pm
Posts: 17
astro wrote:
The iptables 'recent' module doesn't seem to be on my system.

Code:
iptables v1.2.11: Couldn't load match `recent':/lib/iptables/libipt_recent.so: cannot open shared object file: No such file or directory


When compiling iptables, I had to add "recent" to the list of extensions to be made near the top of extensions/Makefile in the source tree.

hth


Top
   
 Post subject:
PostPosted: Sat Jun 25, 2005 7:57 am 
Offline
Senior Member

Joined: Sat Apr 03, 2004 7:44 am
Posts: 64
ICQ: 2623399
Nice script Mike. Unfortunately it only works if your INPUT chain policy is set to ACCEPT (mine is on DROP).


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group