[K12OSN] When keeping login records...

Petre Scheie petre at maltzen.net
Fri Dec 8 15:54:34 UTC 2006


How about a script that greps for today's date in /var/log/messages--I think that's 
where vsftpd logs to--and pipe that to awk for records where field 5 equals vsftpd ($5 
/vsftpd/), and pipe that to awk to select the user ID from the respective field, and 
redirect the output to append to a file.  Something like this:

TODAY=$(date '+%b %e')
grep "^$TODAY" /var/log/messages | awk '$5 ~ /vsftpd/ {print $10}'

I'm assuming here that the user ID is in field 10 in the vsftpd records 
/var/log/messages; I don't run vsftpd anywhere so I can't check it.  Just change the 
variable number to match what is in /var/log/messages.

Petre

ahodson at elp.rr.com wrote:
> Hi list
> 
> I am curious to learn from experienced users, when individual login
> records need to be kept, what are the most popular ways of doing so? I
> am in need of a daily list of who logged into a server (via ftp) so I
> can back up their work.
> 
> Cheers
> 
> Alan Hodson
> El Paso ISD, TX
> http://links.episd.org/
> -=o=-
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
> 




More information about the K12OSN mailing list