Click here to Skip to main content
11,707,470 members (78,520 online)
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 4:55am
Joan Murt86.1K

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 156
1 Sergey Alexandrovich Kryukov 145
2 Mika Wendelius 140
3 chainerlt 110
4 ppolymorphe 104
0 OriginalGriff 9,178
1 Sergey Alexandrovich Kryukov 8,562
2 CPallini 5,189
3 Maciej Los 4,806
4 Mika Wendelius 3,706


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 19 Apr 2013
Copyright © CodeProject, 1999-2015
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