GNU accounting utilities or Acct is a free and open source application for Linux. Using Acct you can get details about system usage, connections, users info, programs executed, and utilization of system resources. It will help system administrators to analyze, investigate and diagnose the users’ activities and more things. In this article we will see how to monitor user activity in Ubuntu using GNU accounting utilities
How to Install Acct on Ubuntu
In the terminal application run below Acct installation command. It will install the latest version of Acct on your Ubuntu Linux system.
sudo apt install acct
It will start automatically after installing it.Now check and verify whether acct service is running or not.
sudo systemctl status acct
You can also turn ON and OFF accounting using below commands.
If you want to OFF use below command.
You can can summarize the information about previously executed commands using sa command.
Show summary of all commands
View number of processes and CPU minutes
Print user id and command name
Using lastcomm command you can display the list of previously executed commands.
For the complete details about lastcomm run below command.
The ac command will display the report of user connect time in hours.
Display total connect time of all users
Total connect of all users by day
Total connect time by user
Total connect time of a specific user
For the complete details run below command.