How To Monitor User Activity In Ubuntu using Acct

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

acct command status

You can also turn ON and OFF accounting using below commands.

accton on

If you want to OFF use below command.

accton off

You can can summarize the information about previously executed commands using sa command.

Also Read:  Viking GPS Data Editing Application

Example:
Show summary of all commands

sa

sa command

View number of processes and CPU minutes

sa -m

Print user id and command name

sa -u

Using lastcomm command you can display the list of previously executed commands.

Example:

lastcomm

lastcomm command

For the complete details about lastcomm run below command.

man lastcomm

The ac command will display the report of user connect time in hours.

Example:

Display total connect time of all users

ac

ac

Total connect of all users by day

ac -d

Total connect time by user

ac -p

Total connect time of a specific user

ac manikandan

For the complete details run below command.

man ac

Source:

If you liked this article, please subscribe to our YouTube Channel. You can also stay connected with us on X (Twitter) and Facebook.



Leave a Reply