Click here to Skip to main content
15,867,750 members
Please Sign up or sign in to vote.
3.00/5 (1 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

1 solution

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 <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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900