[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] When keeping login records...

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.


ahodson 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.


Alan Hodson
El Paso ISD, TX

K12OSN mailing list
K12OSN redhat com
For more info see <http://www.k12os.org>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]