Shell Tools for Watching Users
The acct system accounting package is essential to pull together all the commands you??™ll
need to keep tabs on your system. There are a bunch of handy tools there including sa,
accton, and lastcomm.
You may need to start the acct service at startup. To do this, log in as SuperUser and type
the following:
/etc/init.d/acct start
Monitoring User Activity 413
19
openSUSE will now track resource usage in the /var/run/utmp and /var/log/wtmp files.
You can access these files with the following commands.
The w command will tell the sysadmin who is logged in, where he or she is logged in at,
and what they are up to. No one is able to hide from the SuperUser. The w command can
be followed by a specific user??™s name to show only that user??”by default, it will show all
current users.
The ac command provides information about the total connect time of a user measured
in hours. It accesses the /var/log/wtmp file for the source of its information. To generate a
list of users with their login hours, type the following:
ac ??“p
Even if you??™re a sole user, if you log in and out religiously, you might find this command
useful.
Pages:
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834