LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-03-2014, 09:45 AM   #1
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Rep: Reputation: Disabled
SSH blocking


My server doesn't use SSH and I keep getting hack attempts coming in according to my auth_log. I found this on the web whereby you are supposed to be able to block all SSH connections except those needed (my SSL connection to the server, etc):

iptables -A INPUT -p tcp -s ???.???.???.??? -d $SERVER_IP --sport 513:65535 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT

iptables -A OUTPUT -p tcp -s $SERVER_IP -d ???.???.???.??? --sport 22 --dport 513:65535 -m state --state ESTABLISHED -j ACCEPT

I come into my server through three possible IPs and was wondering if just tripling up on the above INPUT and OUTPUT lines for each of my three IPs would work to get me in from all three.
 
Old 08-03-2014, 10:39 AM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,127

Rep: Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639Reputation: 3639
This has a few ideas to start. http://wiki.centos.org/HowTos/Networ...200f8c1e4324bc Use a few of them then look to next links maybe.



http://serverfault.com/questions/295...s-to-ssh-by-ip
http://eight-eleven.com/news/restric...s-linux-centos


Also might have some features in router/modem to assist.
 
Old 08-03-2014, 12:56 PM   #3
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 258

Original Poster
Rep: Reputation: Disabled
Really good and complete - thanks!
 
  


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
ssh - something's blocking it sycamorex Linux - Networking 6 03-27-2008 12:32 PM
blocking ssh for a user jitheshmurali Linux - Networking 2 05-04-2006 11:44 PM
blocking ssh for a user jitheshmurali Linux - General 2 05-04-2006 08:38 AM
blocking ssh for only 1 user evilchild Linux - Security 2 08-22-2004 06:48 PM
SSH is blocking my connections tarballedtux Linux - Security 8 11-01-2002 04:19 PM

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

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