Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-23-2009, 10:05 AM
|
#1
|
Member
Registered: Sep 2003
Distribution: Slackware
Posts: 626
Rep:
|
Possible attempted hack?
I have very little experience in security matters, so I would appreciate any input.
Noticed these two notifications in /var/log/messages today:
Code:
Mar 23 10:57:41 slack sshd[12012]: Did not receive identification string from 172.**.***.254
Mar 23 13:24:57 slack sshd[17393]: Failed password for root from 172.**.***.254 port 1459 ssh2
I don't recognize the ip. Is this harmless or should I be concerned?
|
|
|
03-23-2009, 10:10 AM
|
#2
|
Member
Registered: Jan 2009
Location: Essex (UK)
Distribution: Home: Debian/Ubuntu, Work: Ubuntu
Posts: 206
Rep:
|
that's normal when you have a box connected to the internet (be it directly or through any other means).
some machines out there run port scanners and then (or w/o running scanners before maybe as well *shrug*) run a bot program
to try a combination of usernames & passwords, or only passwords with un=root.
Depending how your machine is set up, it's a risk or not.
external root login is usually disabled, but I think sshd though allows it by default, so have to change that in config.
I usually just add their IPs to the iptables list
|
|
|
03-23-2009, 10:31 AM
|
#3
|
Senior Member
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833
Rep:
|
Quote:
Originally Posted by mdg
I have very little experience in security matters, so I would appreciate any input.
Noticed these two notifications in /var/log/messages today:
Code:
Mar 23 10:57:41 slack sshd[12012]: Did not receive identification string from 172.**.***.254
Mar 23 13:24:57 slack sshd[17393]: Failed password for root from 172.**.***.254 port 1459 ssh2
I don't recognize the ip. Is this harmless or should I be concerned?
|
Something like this will get rid of repeated attempts:
Code:
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 360 --hitcount 3 --name SSHATTEMPTS --rsource -j DROP
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name SSHATTEMPTS --rsource
Something like this will reject further attempts from that location:
Code:
iptables -I INPUT -s 124.38.246.51 -j DROP
Of course you need to save those somewhere that will be executed on startup if you want them to persist between reboots.
As the other person who replied mentioned, this is a common occurrence for any machine on the internet, if you move the ssh port to something in the normal dataport range you might have better luck not getting port scanned and turning off root logins for ssh is always advisable unless you have a specific need for it.
|
|
|
03-23-2009, 10:41 AM
|
#4
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep:
|
Quote:
Originally Posted by mdg
Code:
Mar 23 10:57:41 slack sshd[12012]: Did not receive identification string from 172.**.***.254
Mar 23 13:24:57 slack sshd[17393]: Failed password for root from 172.**.***.254 port 1459 ssh2
I don't recognize the ip. Is this harmless or should I be concerned?
|
Not harmless. To implement the "disable root login" suggestions, add the following directive to sshd_config and then reload sshd.
Going forward, ssh to your server as a regular user and then su to root.
|
|
|
03-24-2009, 05:18 AM
|
#5
|
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188
Rep:
|
to get rid of those attempts, i always disable root login in sshd config and install denyhosts (1).
Denyhosts reads the logs then it blocks the ip addresses that try to login with incorrect user or pass via ssh. it uses /etc/hosts.deny
(1) http://denyhosts.sourceforge.net/
regards
|
|
|
All times are GMT -5. The time now is 08:08 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|