GIDForums  

Go Back   GIDForums > Web Hosting Forums > Web Hosting Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Dec-2005, 07:05
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 730
admin will become famous soon enough
Post

Re: Disabling root SSH logins


I just posted a GID Community blog entitled: Disabling root SSH logins.

Quote:
My web server was set up just 6 days ago. Within a couple of days, it was already attracting a number of "probes". Casually, I went through the /var/log/messages file. It was amazing... 8O

Everyday, more and more people were attempting to login as root! read more...

Please let me know what you think.

This is an auto-generated message posted by GIDNetwork™ on behalf of the author.
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #2  
Old 11-Dec-2005, 00:53
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,534
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

Re: Disabling root SSH logins


Good stuff! Since I only have mine set up as a testing server right now, I really didn't care about people hacking it. But it's always better to error on the safe side. Thanks!
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
  #3  
Old 30-Mar-2006, 14:22
JagwireHosting JagwireHosting is offline
New Member
 
Join Date: Mar 2006
Posts: 3
JagwireHosting is on a distinguished road

Re: Disabling root SSH logins


A very easy way to avoid these login attempts is set the SSH port to whatever you want :

Edit sshd.config and find the lines :

#Port 22
#Protocol 2,1

Uncomment the lines and change them for example to :
Port 5353
Protocol 2

Then sit and look at your /var/logs/messages
  #4  
Old 30-Mar-2006, 19:42
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Re: Disabling root SSH logins


I am actually quite pleased with all my efforts to curb SSHD abuse like this.

While modifying the config files just means that I am making it a bit harder for the person trying to break-in to the server, it doesn't stop them from trying. On a loaded server, unnecessary "traffic" like this can become a pain.

A few months back, I wrote a PHP script to run every 5 minutes, read the /var/log/messages log file and report back to me any attempts like these. Here is an example email report I received this morning (for me):

Quote:
Mar 30 14:09:06 server sshd(pam_unix)[27262]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=125.249.216.67 user=root

http://www.***.com/tools/whois....125.249.216.67

apf -d 125.249.216.67 SSHD_ABUSE

The first line just shows a line from the log file...

The second line is a link to a web site to find out relevant stuff about the IP.

The third line is something I can quickly copy and paste to block the IP from ever accessing my server.

So far so good, if I am unlucky, I get a "probe" like this once a day... On a good stretch, I get nothing for days. You should see my /etc/apf/deny_hosts.rules file now.
  #5  
Old 21-Apr-2006, 10:51
alwaysweb alwaysweb is offline
New Member
 
Join Date: Apr 2006
Location: Dallas, TX
Posts: 8
alwaysweb is on a distinguished road

Re: Disabling root SSH logins


You may want to periodically empty your deny_hosts.rules file... On occassion we have had a client get themselves blocked by APF after too many failed email or FTP login attempts (BFD sends it to APF to be blocked).

But, almost as important as that is the fact that if your deny_hosts.rules gets huge... and therefore the contents of your IPchains/IPtables is very large, it can actually slow down your server as it has to parse through all the rules every time it receives a connection. It shouldn't be a problem with 50 or 100 or more entries, but if your deny_hosts.rules has entries for months or years, you may want to periodically clear it out

_______________________
Cheers,

Ronnie T. Moore, owner
Messenger: RonnieAWH
http://AlwaysWebHosting.com/ -- Friendly, feature-packed Cpanel hosting, that can't be beat!
 

Recent GIDBlogFirst week of IA training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linspire: Has anyone used it? TerryPearson Computer Software Forum - Linux 16 28-Apr-2005 11:32
Mod rewite to disguise root JUNK KED Apache Web Server Forum 4 09-Jan-2005 05:39
IPv6 added by ICANN to Root Servers 000 Web Hosting Forum 3 23-Jul-2004 04:04

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 21:37.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.