Hi all
I'm trying to write a simple user activity logging program. But Would anyone tell me what's the best way to untherstand that a user have logged in or out
There are many ways to determine usage from users on a system. Your main
system logs are the easiest. The other way is to setup accounting system on box
where it creates more specialized logs of users actions, time on, time off, even
down to more detailed "things" that users would not like you to really know.
the linux system also makes available the /proc system that can be read on
timed basis or even every time the file is written too. I refer to such files
as "utmp" "wtmp" both with good documentation on usage and may be what
your after. The "who" command is one of these tools that reads the utmp file.
So I would probably look in that direction. You might find more info on it also
via the Documentation included in the kernel source.
Also each shell type available keeps a log of activity such as bash's .bash_history
file in home directories of uses if telneted in... the ftp transfer log for their ftps'
so keeping track of what a users does or more is a matter of figuring out..
what parts of users interaction you wish to log.
The users have not any shell (/bin/noshell) so the .shell_history file is unuseable in that case
I need to log only the standart messages that syslogd outputs for the mail (sendmail & pop3 infos) and the traffic for each user in a separate file for any user.
I found the utmp documentation and now I read but I have some problems with associated functions. I keep trying
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.