List of active users, logged in with gdm

Matthew Seaman m.seaman at infracaninophile.co.uk
Wed Mar 12 18:24:46 UTC 2008


Laszlo Nagy wrote:

> I would like to get the list of the users who are actively logged in 
> remotely with gdm, along with their IP address. The commands 'w' and 
> 'users' does not work. What is the right command to get this list?

Let me turn that question around slightly:

   How can I get gdm(8) to record user logins in /var/run/utmp ?

It's the utmp file that commands like w(1) and users(1) read in order
to present the list of logged-in users.  As far as I know this is the
only effective means the system uses to record who is logged in when --
I'm not aware of any gdm(1) specific equivalent.

Now, in order for a login to be recorded in utmp(5) it should suffice to
have a line like:

  session         required        pam_lastlog.so          no_fail

in the appropriate file under /etc/pam.d or /usr/local/etc/pam.d

I'm using /etc/pam.d/xdm as a reference -- xdm(8) is functionally
similar to gdm(8) and I'd think it would have a very similar PAM
configuration.  However I haven't positively verified that, and you'ld
do well to search for PAM-related info in gdm documentation and so
forth.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20080312/2decce96/signature.pgp


More information about the freebsd-questions mailing list