?
Solved

Linux Logging - User Login Attempts

Posted on 2000-03-03
11
Medium Priority
?
449 Views
Last Modified: 2013-12-16
Hello,
  Over the last several days, I have had a hacker breach security on a linux box and use it as a mail relay.  I found out how he did it, the news account was left open for all to see.  What I was wanting to know is this:

Does linux log all login attempts? Where?

When it logs these attempts, does it log the IP address that the attempt was coming from?  Where?

If not.. how can I make it do these things.


Thanks!

0
Comment
Question by:kittlej
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 3

Expert Comment

by:jyu_88
ID: 2580592
use the command 'last' to check users login history (telnet, ftp, ssh, etc.) since last reboot. It is parsing /var/log/wtmp.
jyu      ftp          bac.bogus.com Thu Mar  2 18:30 - 18:31  (00:00)    
jyu      ftp          bac.bogus.com Thu Mar  2 18:30 - 18:30  (00:00)    
jyu      ftp          bac.bogus.com Thu Mar  2 18:28 - 18:29  (00:01)    
jyu      ftp          bogus.bogus.co Thu Mar  2 18:07 - 18:07  (00:00)    
jyu      pts/1        bogus.remote.com. Thu Mar  2 17:45 - 17:48  (00:02)    
jyu      pts/0        server1.bogus.com Thu Mar  2 16:53 - 18:38  (01:44)    
..................morehere.............
0
 
LVL 1

Author Comment

by:kittlej
ID: 2580706
What about failed attempts?
0
 
LVL 1

Author Comment

by:kittlej
ID: 2580746
What about failed attempts?
0
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 
LVL 40

Expert Comment

by:jlevie
ID: 2580875
Syslog logs all login access, successful and failed attempts in the /var/log/message* files. Failed sessions show the username tried and the reason for failure. Since the syslog data goes back further in time, it's a better way of lookin at access, but it won't give you the remote IP.
0
 
LVL 1

Author Comment

by:kittlej
ID: 2580890
But is there a way that I can set it up so that every login attempt - successful or failed - is logged to a file with the ip address of the user?
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2581046
I don't think so with native facilities, but I'll see what I can find for you.
0
 
LVL 2

Expert Comment

by:bernardh
ID: 2581101
i'm not sure if linux has some kind of utility like iptrace/ipreport of aix but  there is a linux utility from
www.bandmin.org called bandmin that i believe does ip tracing. check it out.
0
 
LVL 2

Expert Comment

by:bernardh
ID: 2582147
by the way, have you tried the lastlog command? it shows what username was used, the port number as well as the hostname of the culprit, try it.
0
 
LVL 8

Expert Comment

by:stefanx
ID: 2582761
For telnet attempts, just grep telnet from you /var/log/syslog file...
0
 
LVL 40

Accepted Solution

by:
jlevie earned 150 total points
ID: 2583250
Hmm, everyone has been focused on the exact guestion (including myself) and has ingnored the more basic issue.

While it would be nice to have a log of of all login attempts that included the IP, there can be other ways for an attacker to penetrate a Unix system. You might want to take a look at http://www.sans.org/newlook/projects/bastille_linux.htm and at the Security HowTo.
0
 
LVL 1

Author Comment

by:kittlej
ID: 2587286
Thanks to all who helped in this question, I'm awarding the points to jlevie because he had the most useful information, but I wish to accredit all of you who participated, as you have each helped in your own way.  Thanks!
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question