Tracking users logging in and out
Yan Seiner
yan at cardinalengineering.com
Thu Jan 24 16:02:04 GMT 2002
Hmmm.
I don't see how you can discern the "intent" of the user. Windows
logins are share based. If a user logs out intentionally, you want to
log that. If, however, he is logged out due to inactivity or because he
has dicsonnected from a share like a printer, you don't want to log
that.
I check for active logins a simple inetd script on a specific port which
simply spews forth a list of IPs which currently have samba
connections. It would be trivial to change it to return user logins.
Wht I do is scan a samba server every 10 minutes, and look in the utmp
file for any open connections. If I find any, the user is still live.
If I don't, he is logged out.
Also, I've run some very informal testing, and an inactive share stayed
connected overnight. This is with Win98 and ME.
I don't know under what conditions an active connection would be
connected and disconnected many times an hour.
--Yan
Antony Healey wrote:
>
> All very good ideas, unfortunately the following happens...
>
> For utmp, preexec and postexec, they are share based. Shares are not
> persistant and the user gets "logged out" after a period of time, until they
> use ("log in to") it again. This ends up meaning that during the course of 1
> hour behind a computer, the user could appear to log in and out many many
> times.
>
> We're also running Tru64, which doesn't support PAM that I'm aware of.
>
> Any other suggestions would be great!
>
> Regards,
> Antony.
--
Daddy, did all the hair that fell off your head stick to your arms?
Akari, age 4
...
oberon.cardhome.lan: 6:48pm up 5 days, 6:40, 6 users, load average:
0.41, 0.17, 0.05
More information about the samba
mailing list