[Samba] Login time logging?
samba at vaag.nu
Mon Feb 2 08:16:14 GMT 2004
I just tried using the netlogon share to see whether certain machines come
up on the net.
The problem is that only machines that are running Win9x appear, anything
more modern like XP clients do not seem to connect to netlogon? There is
no entry in the log at least.
On Sun, 1 Feb 2004 mamue at lb-bbs1.emd.ni.schule.de wrote:
> > On Fri, 2004-01-30 at 23:49, Remco Barendse wrote:
> >> Hi all!
> >> I need a setup that will log exactly when a user has logged in or out of
> >> samba.
> >> Preferably I would like to have a separate list per user, but this can
> >> also be achieved with grep.
> >> I found some solutions that rely on login script processing which is
> >> nice
> >> if your clients are running Win95/Win98 but for anything else it won't
> >> work.
> >> Anybody know of a solution?
> > Many people enable utmp support on the server for this.
> I have in [netlogon] a
> root preexec = /usr/local/samba/bin/netlogon-preexec.sh %u %I %m %T
> shell-script which does:
> #1.: user, %u
> #2.: Client-IP, %I
> #3.: NetBIOS Machine name, %m
> #4/5.: Timestamp, %T
> #6.: Group, %g
> #4/5 (Timestamp) are no longer used
> /samba/netlogon/generateLoginBatch $1 $2 $3
> echo "insert into logins (user, host, ip, date, time) values ('$1', '$3',
> '$2', curdate(), curtime() );" | /usr/bin/mysql -u mysqlUser sambaLogins
> Windows does (AFAIK) not have the concept of logout-scripts, so you'll
> never know when people log out. When I have spare time I sometimes
> generate a little machine-usage report from that data.
More information about the samba