Monitor User Activity with psacct or acct Tools
The psacct or acct package provides several features for monitoring process activities.
- ac command prints the statistics of user logins/logouts (connect time) in hours.
- lastcomm command prints the information of previously executed commands of user.
- accton commands is used to turn on/off process for accounting.
- sa command summarizes information of previously executed commands.
- 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