>
>
>Does anyone know who to display the number of days since the last login? I know about the last command. That's not what I need. I just an integer that displays the number of days since the users last login.
>
>
>Thanks in advance.

I can't think of any security vulnerabilities about the finger command on the localhost. You must be confusing the finger command issued for a local user with the inetd finger daemon, which should be deactivated because of security concerns. Otherwise one could find out the names of the existing users and by this easing the brute force ssh attacks.

Anyway, I'm glad you could solve it with the "last" command.

Regards,
Viktor

john1209 email@removed wrote:

>
>
>No, quite contrary. I do want to use last. It's the finger command I cannot use (forbidden by security).
>
>
>Not sure how your interpretation of last works below.
>
>
>Here is what I get on Red Hat.....
>
>
>[email@removed]# last john -n1
>john pts/28 10.88.29.31 Mon May 21 20:53 - 21:38 (00:45)
>
>wtmp begins Mon May 7 04:09:24 2012
>
>
>
>I can grep and awk the date information from the output. But I need it to report just the number of days since the last login.
>
>
>So is there a way to get an output like....
>
>
>john 2
>
>
>
>That represents two days since the last successful login.
>
>
>Thanks,
>

NAME
last, lastb - show listing of last logged in users
SYNOPSIS
last [-R] [-num] [ -n num ] [-adiox] [ -f file ] [ -t YYYYMMDDHHMMSS ] [name...] [tty...]
lastb [-R] [-num] [ -n num ] [ -f file ] [ -t YYYYMMDDHHMMSS ] [-adiox] [name...] [tty...]
DESCRIPTION
Last searches back through the file /var/log/wtmp (or the file designated by the -f flag) and displays a list of all users logged in (and out) since that file was created. Names of users and tty's can be given, in which case last will show only those entries matching the arguments. Names of ttys can be abbreviated, thus last 0 is the same as last tty0.

Copyright 1998-2015 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective companies. Toolbox.com is not
affiliated with or endorsed by any company listed at this site.