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.4K

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 299
1 Maciej Los 295
2 Sergey Alexandrovich Kryukov 205
3 Aajmot Sk 202
4 Sinisa Hajnal 166
0 OriginalGriff 7,760
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,785


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.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