Monitor User Activity with psacct or acct Tools

The psacct or acct package provides several features for monitoring process activities.

  1. ac command prints the statistics of user logins/logouts (connect time) in hours.
  2. lastcomm command prints the information of previously executed commands of user.
  3. accton commands is used to turn on/off process for accounting.
  4. sa command summarizes information of previously executed commands.
  5. last and lastb commands show listing of last logged in users.

Installing psacct or acct Packages
# yum install psacct
To install acct package using apt-get command under Ubuntu / Debian / Linux Mint.

$ sudo apt-get install acct
OR
# apt-get install acct

Starting psacct or acct service

# /etc/init.d/psacct status
Process accounting is disabled. IF it is disabled then
# /etc/init.d/psacct start
Commands:
Display Statistics of Users Connect Time: # ac
Display Statistics of Users Day-wise: # ac -d
Display Time Totals for each User: # ac -p
Display Individual User Time: # ac tecmint
Display Day-Wise Logn Time of User: # ac -d tecmint
Print All Account Activity Information: # sa
Print Individual User Information: # sa -u

About the author

Janaki(http://mjanaki.com) - A Software developer with 9+ years of experience in multiple technology projects across web, mobile, and cloud applications with expertise in PHP, C#, MySQL, Web services and open source platforms.

Similar Posts

Open SSL Commands
Install Jenkins in Amazon Linux2

Leave a reply

required*

Eye Test: * Time limit is exhausted. Please reload CAPTCHA.