Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Linux Logging - User Login Attempts

Posted on 2000-03-03
11
Medium Priority
?
453 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
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

885 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