LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-09-2009, 10:52 AM   #1
Xerop
Member
 
Registered: Jan 2004
Distribution: Suse, Red Hat
Posts: 129

Rep: Reputation: 15
ssh authentication log - 5 lines


Hello,

I recently logged in to my server machine and found a login record I cannot account for. I have the logs of the login, but they seem strange to me.
I see an authentication failure that says failed password and then it comes up with a accepted password and session opened.
Does this essentially mean that someone connected, typed in the wrong password and then on the second attempt got it right - without reconnecting?

I did a quick look up of the remote host. Seattle seems to have been the origin and not being in Seattle makes me think that I wasn't the one to log in - I don't remember loging in on that day at all.

I have already changed my passwords for my system and moved my ssh port. Any other suggestions?

(I have been planning to do an upgrade to my system recently - so potentially I will be reinstalling the whole system.)

Log:
Code:
Jun  4 23:48:10 Server sshd[9659]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxxxxx6d0.tmxxxx.net  user=xxxxxxxx
Jun  4 23:48:12 Server sshd[9659]: Failed password for xxxxxxxx from 208.54.14.91 port 41459 ssh2
Jun  4 23:48:16 Server sshd[9659]: Accepted password for xxxxxxxx from 208.54.14.91 port 41459 ssh2
Jun  4 23:48:16 Server sshd[9663]: pam_unix(sshd:session): session opened for user xxxxxxxx by (uid=0)
Jun  4 23:49:44 Server sshd[9663]: pam_unix(sshd:session): session closed for user xxxxxxxx

Thank you for any responses,
Yevgeniy
 
Old 06-09-2009, 12:18 PM   #2
Xerop
Member
 
Registered: Jan 2004
Distribution: Suse, Red Hat
Posts: 129

Original Poster
Rep: Reputation: 15
I did understand the Log fine correctly - the first password attempt was a failure and the second attempt worked.
As far as additional measures - I found I should disable passwords for SSH and just use key files.

Checked processes, crontabs and ports on the machine - nothing outside of what was expected.

links - used to obtain info:
http://www.hackinglinuxexposed.com/a.../20030515.html
http://web.archive.org/web/200801092...checklist.html


Google search to get port info:
"port #### auditmypc"


Awesome idea for security:
Quote:
Originally Posted by rweaver View Post
If you have iptables available you can do something like this...

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
Basically that means if someone attempts to connect more than 3 times in six minutes to ssh, drop their ip until there is 6 minutes of quiet time.

It'll get rid of most of your attempts on ssh. A strong password if your ssh is using passwords is more important... not using passwords, port knocking, etc is even better yet.
Maybe someone will find this useful.

Moderator: Sorry, this might fit with "Failed SSH login attempts"
 
  


Reply



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
scp without authentication and ssh with authentication? bkcreddy17 Linux - Server 7 10-08-2008 01:33 AM
some strange lines in /var/log/boot ekdya Debian 1 09-18-2006 08:05 AM
Traffic attack, many lines in web log. vincentltl Linux - Software 2 04-03-2006 06:55 AM
how to extract certain lines from a log file Avatar Linux - Newbie 3 02-11-2005 09:51 AM
/etc/securetty --> I commented out all lines and I can still log in as root adamrau Linux - Security 2 05-30-2004 06:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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

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