f



gdm: how do I log who logs in?

Hi All,

Is there a way to have gmd log who logs in and
when they logged back out?  Not having much luck
Googling this.  :-(

Many thanks,
-T

# ls -al /var/log/gdm
....
-rw-r--r--  1 root root 1132 May  4 08:31 :0.log
-rw-r--r--  1 root root 1132 Apr 19 19:24 :0.log.1
-rw-r--r--  1 root root 1132 Apr 19 16:37 :0.log.2
-rw-r--r--  1 root root 1187 Apr 19 16:37 :0.log.3
-rw-r--r--  1 root root 1132 Apr 11 08:14 :0.log.4

Note that my logs files are all one byte long.
0
todd1749 (255)
5/4/2011 6:50:13 PM
comp.os.linux.misc 33599 articles. 1 followers. amosa69 (78) is leader. Post Follow

6 Replies
711 Views

Similar Articles

[PageSpeed] 57

On May 4, 2011 14:50, in comp.os.linux.misc, Todd@invalid.com wrote:

> Hi All,
> 
> Is there a way to have gmd log who logs in and
> when they logged back out?  Not having much luck
> Googling this.  :-(

gdm, like all other "login methods" updates utmp and wtmp when users log in
and log out.

You can use 
  /usr/sbin/lastlog
or
  /usr/bin/last
to see the last login/logout times for all users.

Additionally,
  /usr/bin/who
will tell you who's logged in (and at what time), and
  /usr/bin/w
not only reports who's logged in, but what they are currently doing

HTH
-- 
Lew Pitcher
Master Codewright & JOAT-in-training   | Registered Linux User #112576
Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/
----------      Slackware - Because I know what I'm doing.         ------


0
lpitcher2 (882)
5/4/2011 6:59:29 PM
Todd <Todd@invalid.com> writes:

> Hi All,
>
> Is there a way to have gmd log who logs in and
> when they logged back out?  Not having much luck
> Googling this.  :-(

Have a look in /var/log/auth.log (assuming you have auth.*/authpriv.*
logged there).

-- 
http://www.greenend.org.uk/rjk/
0
rjk (534)
5/4/2011 7:00:19 PM
On 05/04/2011 12:00 PM, Richard Kettlewell wrote:
> Todd<Todd@invalid.com>  writes:
>
>> Hi All,
>>
>> Is there a way to have gmd log who logs in and
>> when they logged back out?  Not having much luck
>> Googling this.  :-(
>
> Have a look in /var/log/auth.log (assuming you have auth.*/authpriv.*
> logged there).
>
Don't have one of those, but I appreciate the help!

-T
0
todd1749 (255)
5/4/2011 8:29:03 PM
On 05/04/2011 11:59 AM, Lew Pitcher wrote:
> On May 4, 2011 14:50, in comp.os.linux.misc, Todd@invalid.com wrote:
>
>> Hi All,
>>
>> Is there a way to have gmd log who logs in and
>> when they logged back out?  Not having much luck
>> Googling this.  :-(
>
> gdm, like all other "login methods" updates utmp and wtmp when users log in
> and log out.
>
> You can use
>    /usr/sbin/lastlog
> or
>    /usr/bin/last
> to see the last login/logout times for all users.
>
> Additionally,
>    /usr/bin/who
> will tell you who's logged in (and at what time), and
>    /usr/bin/w
> not only reports who's logged in, but what they are currently doing
>
> HTH

Wow.  Thank you.  Even better than what I asked!

-T
0
todd1749 (255)
5/4/2011 8:29:27 PM
On 2011-05-04, Todd <Todd@invalid.com> wrote:
> Hi All,
>
> Is there a way to have gmd log who logs in and
> when they logged back out?  Not having much luck
> Googling this.  :-(
>
> Many thanks,
> -T
>
> # ls -al /var/log/gdm
> ...
> -rw-r--r--  1 root root 1132 May  4 08:31 :0.log
> -rw-r--r--  1 root root 1132 Apr 19 19:24 :0.log.1
> -rw-r--r--  1 root root 1132 Apr 19 16:37 :0.log.2
> -rw-r--r--  1 root root 1187 Apr 19 16:37 :0.log.3
> -rw-r--r--  1 root root 1132 Apr 11 08:14 :0.log.4
>
> Note that my logs files are all one byte long.

Are you looking at the "1" in the second column, which is the number of
links? Each file appears to be at least 1132 bytes long. On my system, 
these files don't show who logged in and out, they log the startup of
the X server. Use the "last" command to see who logged in.


-- 
"I bet Bin Laden regrets allowing his iPhone app to 'use his current
location'" --"Megan", comment on news.yahoo.com
0
bill7345 (150)
5/5/2011 7:35:49 PM
On 05/05/2011 12:35 PM, Bill Marcum wrote:
> On 2011-05-04, Todd<Todd@invalid.com>  wrote:
>> Hi All,
>>
>> Is there a way to have gmd log who logs in and
>> when they logged back out?  Not having much luck
>> Googling this.  :-(
>>
>> Many thanks,
>> -T
>>
>> # ls -al /var/log/gdm
>> ...
>> -rw-r--r--  1 root root 1132 May  4 08:31 :0.log
>> -rw-r--r--  1 root root 1132 Apr 19 19:24 :0.log.1
>> -rw-r--r--  1 root root 1132 Apr 19 16:37 :0.log.2
>> -rw-r--r--  1 root root 1187 Apr 19 16:37 :0.log.3
>> -rw-r--r--  1 root root 1132 Apr 11 08:14 :0.log.4
>>
>> Note that my logs files are all one byte long.
>
> Are you looking at the "1" in the second column, which is the number of
> links?Each file appears to be at least 1132 bytes long.

On now that is embarrasing.  I have been administering UNIX for
over 20 years.

> On my system,
> these files don't show who logged in and out, they log the startup of
> the X server. Use the "last" command to see who logged in.


Love the "last" command.  Thank you.

-T

0
todd1749 (255)
5/6/2011 8:46:12 PM
Reply: