Click here to Skip to main content
13,046,176 members (69,587 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 M90.5K

1 solution

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

Solution 1


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 <username>" to see the login history of a single user. Replace "<username>" 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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 19 Apr 2013
Copyright © CodeProject, 1999-2017
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