Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Linux
I would like to get a list of logins username and time that have happened in the physical server machine by e-mail daily.
 
Any advice on how can I do it?
 
Thank you in advance!
Posted 19-Apr-13 5:55am
Joan Murt82.8K

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
How to View Linux Login History
 
The Linux operating system is a multi-user operating system. This means that more that one user can be logged on to a single computer at a time. The "last" command is used to display a login history for all users. It can also be used to show the login history of a single user. If the users are logging into from a remote location, you can use the "-a" option with the command to show the IP address of the remote computer.
 
1. Open a terminal window which is found under the "System Tools," "Utilities" or "Accessories" section of the main menu depending on your distribution.
 
2. Type the command "last" to see the login history of all users.
 
3. Type the command "last " to see the login history of a single user. Replace "" with the username for the particular user.
 
4. Type the command "last -a" to see the login history along with the IP address of the computer the user logged in from (the user's local computer).
 
5.Type the command "exit" to close the terminal window.
 
You will need a first component to retreive the user login history information, and a second component with the capacity to send the mail message. You may need a third component for scheduling the operations, otherwise use a system scheduler.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 325
1 Sergey Alexandrovich Kryukov 289
2 CPallini 275
3 DamithSL 260
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 19 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100