[Samba-it] Report di accesso account al dominio

Massimo Mancini mmancini at iol.it
Sun Apr 20 22:31:13 MDT 2008


la spiegazione la trovi all'inizio di questa pagina:

http://www.reteisi.org/twiki/bin/view/Reteisi/DocTrucchi

funziona bene, a parte il troncamento del nome utente a 8 caratteri (che e'
una caratterisrica di last, andrebbe patchato e  ricompilato). In
alternativa puoi provare la seguente riga pern ;-))

perl -we '@type=("Empty","Run Lvl","Boot","New Time","Old
Time","Init","Login","Normal","Term","Account");$recs = ""; while (<>)
{$recs .= $_};foreach (split(/(.{384})/s,$recs)) {next if length($_) == 0;my
($type,$pid,$line,$inittab,$user,$host,$t1,$t2,$t3,$t4,$t5) = $_
=~/(.{4})(.{4})(.{32})(.{4})(.{32})(.{256})(.{4})(.{4})(.{4})(.{4})(.{4})/s;if
(defined $line && $line =~ /\w/) {$line =~ s/\x00+//g;$host =~
s/\x00+//g;$user =~ s/\x00+//g;printf("%s %-8s %-12s %10s %-45s
\n",scalar(gmtime(unpack("I4",$t3))),$type[unpack("I4",$type)],$user,$line,$host)}}print"\n"'
< /var/log/samba/wtmp/wtmpx

della serie: ma che problema c'e'! basta un comando di shell....

max



On Sun, Apr 20, 2008 at 11:18:02PM +0200, Dario Lesca wrote:
> Il giorno dom, 20/04/2008 alle 16.10 -0400, simo ha scritto:
> 
> > Se esegui 'smdb -b |grep -i utmp' te lo dice.
> 
> Ok, c'e (ho anche guardato il src.rpm):
> 
> > [root at igloo templates]# /usr/sbin/smbd -b |grep -i utmp
> >  UTMP Options:
> >    HAVE_GETUTMPX
> >    HAVE_UTMPX_H
> >    HAVE_UTMP_H
> >    PUTUTLINE_RETURNS_UTMP
> >    WITH_UTMP
> >    WITH_UTMP
> 
> Quindi da cosa potrebbe dipendere il fatto che non mi registra l'accesso
> (non mi crea il file) utilizzando la direttiva 'wtmp directory
> = /var/log/samba'
> 
> Non è che devo specificare la directory in cui si trova il wtmp di
> sistema (/var/log/)?
> 
> Ho provato a cercare in internet ma non ho trovato molto ...
> 
> In alcuni siti si consiglia di utilizzare le seguenti direttive:
> 
> > http://www.lll.lu/Presentations/LinuxDay2005/samba.pdf
> > Account samba sessions in wtmp (last): Define following on share
> > root preexec = /usr/X11R6/bin/sessreg -l %m -h %M -a %u
> > root postexec = /usr/X11R6/bin/sessreg -l %m -h %M -d %u
> > _________________(/usr/bin/sessreg)
> 
> Per ora non le ho ancora provate,
> 
> Voi cosa consigliate?
> 
> Ciao e Grazie.
> 
> -- 
> Dario Lesca <d.lesca at solinos.it>
> 
> _______________________________________________
> Samba-it mailing list
> Samba-it at xsec.it
> https://lists.xsec.it/mailman/listinfo/samba-it



More information about the samba-it mailing list