View previous topic :: View next topic |
Author |
Message |
jean-michel Tux's lil' helper
Joined: 30 May 2002 Posts: 142 Location: Somewhere East of the Atlantic
|
Posted: Wed Dec 04, 2002 3:46 pm Post subject: who command doesn't show all users |
|
|
Greetings,
After searching the forums I haven't manage to stumble onto an answer to this, so while I'm surprised it isn't a FAQ, I guess I'll go ahead and ask.
Users who are logged in via (xdm|kdm|gdm) are not displayed when the "w", "who", etc. commands are run (though of course anyone else, logged in via a standard pts device, is).
For example:
Code: |
tablet22 gdm # w
9:37am up 2 days, 1:08, 5 users, load average: 0.20, 0.19, 0.20
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 jordan.sys.kcco. 7:46am 1:47m 0.04s 0.04s -bash
root pts/1 guiness.sys.kcco Mon 1pm 43:58m 0.05s 0.05s -bash
root pts/2 brazil.sys.kcco. 8:58am 0.00s 0.13s 0.02s w
jdeng pts/3 peru.sys.kcco.co 8:35am 15:32 0.06s 0.06s -bash
root pts/4 mauritius.sys.kc 8:37am 35:35 0.08s 0.08s -bash
|
while ps reveals that another user is in fact logged in via xdm:
Code: |
nfc 14252 0.0 0.3 2216 1016 ? S 08:12 0:00 /bin/sh /usr/X11R6/lib/X11/xdm/Xsession
|
Is there a quick and easy setting or tweak one could do to change this behavior, so that all of the users are displayed via the 'w' or 'who' command? This would be very handy for seeing who is logged into what machine, a feature I sometimes need if the user who is calling ins't sure which machine they are on and I'm forced to guess. Yes, I can run 'ps' and see what user processes are running as whom, but I'd really like to get the old 'who' behavior back.
Many thanks in advance for any enlightenment,
Jean. _________________ The Struggle for the Future of Human Evolution Begins: Autonomy the SciFi Series! |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20092
|
Posted: Wed Dec 04, 2002 5:23 pm Post subject: |
|
|
Different than this thread? _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
jean-michel Tux's lil' helper
Joined: 30 May 2002 Posts: 142 Location: Somewhere East of the Atlantic
|
Posted: Fri Dec 06, 2002 4:23 pm Post subject: Yes |
|
|
Yes, it is different from that thread because I'm not talking about console windows or xterms, I'm talking about the x session started by gdm/kdm/xdm itself. I don't mind the various xterms not showing up (in fact, I like that behavior), but it would be nice if at least the X session itself showed up in a 'who' listing.
Is there a trick to getting gdm (kdm and xdm for that matter) to report a user's presence when they log in? The man pages seem to be unrevealing on this point, as does a search of the archives here. _________________ The Struggle for the Future of Human Evolution Begins: Autonomy the SciFi Series! |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20092
|
Posted: Fri Dec 06, 2002 6:32 pm Post subject: Re: Yes |
|
|
jean-michel wrote: | Yes, it is different from that thread because I'm not talking about console windows or xterms, I'm talking about the x session started by gdm/kdm/xdm itself. |
delta407 wrote: |
When you're logged in to KDE, it's not technically a "login" as far as the kernel is concerned. |
Quote: | Is there a trick to getting gdm (kdm and xdm for that matter) to report a user's presence when they log in? | I'm not very familiar with the graphical login managers. Have you tried google? _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
jean-michel Tux's lil' helper
Joined: 30 May 2002 Posts: 142 Location: Somewhere East of the Atlantic
|
Posted: Fri Dec 06, 2002 9:37 pm Post subject: Gentoo behaves differently than the other distros: Why? |
|
|
Quote: |
I'm not very familiar with the graphical login managers. Have you tried google?
|
*sigh*
Yes, I've tried google, to no avail. I've tried these fora, apparantly also to no avail.
As others have noted, no other distro appears to behave this way ... this quirk appears to be, if not unique to Gentoo, at least a trait Gentoo shares with very few distros, and none of the other major ones.
Debian, Mandrake, Red Hat, and Suse all show the logged in user, regardless of whether or not that user logged in via xdm, kdm, gdm, or the console. Gento does not. Dismissing this as "well, Ndm (n=x,k,g) isn't technically a login to the kernel" is simply a copout ... it obviously is considered a login session in most other distros.
The question remains, and it remains unanswered: what is so different about Gentoo that makes it behave in such a non-intuitive manner, contrary not only to one's intuition, but to the behavior of most other GNU/Linux distros? I'm not advocating Gentoo change is some fashion, I merely waht to understand what the hell is going on so I can change that behavior myself, to my own (and my colleague's) satisfaction.
The argument that this behavior is somehow an xdm/kernel quirk, and not a Gentoo quirk, to be singularly unconvincing, given the contrasting behavior of Red Hat, Mandrake, Suse, etc.
E.g. Debian
Code: |
venezuela:~# uname -a
Linux venezuela 2.4.16-xfs-debian-3.0-test #1 SMP Sat Dec 8 14:25:38 CST 2001 i686 unknown
venezuela:~# who
pbf :0 Dec 6 06:47
root pts/0 Dec 6 15:31 (brazil.sys.kcco.com)
|
vs. Gentoo
Code: |
Linux alderaan.front.kcco.com 2.4.19-gentoo-r9 #1 SMP Wed Oct 2 12:14:00 CDT 2002 i686 AuthenticAMD
alderaan root # who
root pts/0 Dec 6 15:32 (brazil.sys.kcco.com)
|
(pbf is logged in to via kdm/gdm and running an x session on both machines)
This isn't [x|g|k]dm, this isn't the kernel, this is Gentoo being different, and I'd really like to know the how and why, so I can modify the behavior to suit the expectations of myself and my colleagues.
many thanks in advance to anyone who can shed some light on this. _________________ The Struggle for the Future of Human Evolution Begins: Autonomy the SciFi Series! |
|
Back to top |
|
|
procon n00b
Joined: 21 Feb 2003 Posts: 7 Location: New York
|
Posted: Mon Feb 24, 2003 6:00 pm Post subject: |
|
|
I have used Red Hat 6.2 and noticed that same EXACT problem you are experiencing. I haven't tested Red Hat 7.x to see if it has the same behavior, but the 6.2 behavior was annoying. I've seen this using VNC as well as xdm. |
|
Back to top |
|
|
clockwise Apprentice
Joined: 24 Aug 2002 Posts: 152 Location: uk
|
Posted: Tue Feb 25, 2003 10:49 pm Post subject: |
|
|
hmm... stumbled across this post randomly, so checked my "who" output. it does show me as logged in through x...
Code: |
$ who
root vc/1 Feb 25 22:46
clockwis :0 Feb 25 21:50
clockwis pts/3 Feb 25 22:46 (localhost)
|
the only thing i can think of is that i'm using PAM. i' using the gentoo-sources and haven't added (or subtracted) anything to major from my USE variables. _________________ "if an injury has to be done to a man it should be so severe that his vengeance need not be feared." - niccolò machiavelli |
|
Back to top |
|
|
barran Tux's lil' helper
Joined: 14 Jan 2003 Posts: 142 Location: Århus, DK
|
Posted: Mon Mar 31, 2003 6:34 pm Post subject: |
|
|
So why does noone know anything about this. I got here via the link in the faq.
I would too like know why gentoo is showing incorrectly number of logged in users.
Other distros dont have this behaviour so why does Gentoo? What can I do to force w, who and whatever to show that I am logged in? |
|
Back to top |
|
|
clockwise Apprentice
Joined: 24 Aug 2002 Posts: 152 Location: uk
|
Posted: Mon Mar 31, 2003 10:31 pm Post subject: |
|
|
i've just looked at this again briefly... the important file is /var/run/utmp which is where logins are recorded. however, i'm not sure that it is the responsibility of [x|g|k]dm to write this entry, rather the x start-up.
i'll do a bit more research. _________________ "if an injury has to be done to a man it should be so severe that his vengeance need not be feared." - niccolò machiavelli |
|
Back to top |
|
|
barran Tux's lil' helper
Joined: 14 Jan 2003 Posts: 142 Location: Århus, DK
|
Posted: Mon May 26, 2003 7:28 am Post subject: Grsecurity |
|
|
I've found out that it is grsecurity that is causing this behavior. It hides users and processes for users so they can't see whether an admin is logged on or not.
That has the effect that it appears that no users are logged in, and users not in the wheel group can only see their own processes via ps or similar tools.
Anyway try disabling grsecurity in your kernel - but enable some of it back. It really add effective security to the kernel. Grsecurity fx. prevents people from using the ptrace security hole because of random process ids.
This should finally bring some light on this... |
|
Back to top |
|
|
orionrobots Apprentice
Joined: 07 Oct 2003 Posts: 289 Location: London, Uk
|
Posted: Tue Dec 30, 2003 2:30 pm Post subject: Re: Grsecurity |
|
|
barran wrote: | I've found out that it is grsecurity that is causing this behavior. |
Hmm - I wonder if any mandrake users have experienced this - later versions of mandrake come with most grsecurity options compiled into the kernel. It would almost make sense to disallow an unprivellidged or general user from seeing admin activity.
Does it effect the output of ps -efl? Some command lines will reveal all of their parameters with the l switch - which could compromise security in some situations. |
|
Back to top |
|
|
barran Tux's lil' helper
Joined: 14 Jan 2003 Posts: 142 Location: Århus, DK
|
Posted: Tue Jan 27, 2004 11:53 am Post subject: |
|
|
Quote: | Does it effect the output of ps -efl? Some command lines will reveal all of their parameters with the l switch - which could compromise security in some situations. |
Yes ps -efl only show information about your own processes if you are not root or in the wheel group. |
|
Back to top |
|
|
keyser_soze Apprentice
Joined: 19 Oct 2004 Posts: 162 Location: Australia
|
Posted: Tue Oct 19, 2004 4:45 am Post subject: |
|
|
Found this out...
Use sessreg to fix your problem call it when xdm/kdm/gdm/entrance starts your WM
Quote: | NAME
sessreg - manage utmp/wtmp entries for non-init clients
|
Quote: | USAGE
In Xstartup, place a call like:
sessreg -a -l $DISPLAY -x /usr/X11R6/lib/xdm/Xservers $USER
and in Xreset:
sessreg -d -l $DISPLAY -x /usr/X11R6/lib/xdm/Xservers $USER
|
This might be the problem |
|
Back to top |
|
|
barran Tux's lil' helper
Joined: 14 Jan 2003 Posts: 142 Location: Århus, DK
|
Posted: Tue Oct 19, 2004 6:09 am Post subject: |
|
|
You mean this might fix the problem??? |
|
Back to top |
|
|
keyser_soze Apprentice
Joined: 19 Oct 2004 Posts: 162 Location: Australia
|
Posted: Tue Oct 19, 2004 6:36 am Post subject: |
|
|
maybe
I have been looking for a solution. I have been fiddling with sessreg but I can't get it to work 100%
It definatly adds users to the who command
try as root
sessreg -a joebloggs
who will show joebloggs in users...
but in terms of launching it with X... still doesn't seem to be working... but I am sure this is how to do it. look at the man of sessreg |
|
Back to top |
|
|
ljgibson n00b
Joined: 06 Nov 2004 Posts: 9 Location: Florida
|
Posted: Sat Nov 06, 2004 9:39 pm Post subject: |
|
|
I'm running xdm and icewm, and have also experimented with sessreg with no success so far (other than success issuing sessreg commands as root in a terminal). I've seen some advice which says to place the appropriate sessreg commands in the GiveConsole and TakeConsole scripts in /etc/X11/xdm, but for me this resulted in being automatically logged out /immediately/ after logging in (so quickly that the icewm desktop never showed up). I'd like to make sessreg work from Xstartup and Xreset like the man pages recommend.
On my system, /var/log/xdm.log logs two errors reported by xmd:
(EE) Unable to locate/open config file
and
(EE) open /dev/fb0: Unknown error 999
I don't know what the second error means, but my xdm-config file resides in /etc/X11/xdm and has a symlink pointing to it in /usr/X11R6/lib/X11/xdm.
Has anyone else seen and fixed either of these two errors? Perhaps fixing these would also fix the use of sessreg in Xstartup and Xreset? |
|
Back to top |
|
|
barran Tux's lil' helper
Joined: 14 Jan 2003 Posts: 142 Location: Århus, DK
|
Posted: Mon Nov 08, 2004 8:35 am Post subject: |
|
|
Some magic is done in the scripts in /etc/X11/gdm/{PreSession,PostSession} which could give a clue how to do it.
It works fine for me in Gnome now. So I have it fixed without doing a thing .
Dont ya just love Gentoo
Oh. The version of my gdm is 2.6.0.4-r1
Finally this seems to be solved. |
|
Back to top |
|
|
ljgibson n00b
Joined: 06 Nov 2004 Posts: 9 Location: Florida
|
Posted: Tue Nov 09, 2004 2:36 am Post subject: |
|
|
I just emerge'd gdm, and as noted that certainly fixes the problem. Why sessreg doesn't work as advertised for xdm is unknown to me.
Thanks (and yes, I'm thoroughly pleased with Gentoo!). |
|
Back to top |
|
|
keyser_soze Apprentice
Joined: 19 Oct 2004 Posts: 162 Location: Australia
|
Posted: Tue Nov 09, 2004 2:59 am Post subject: |
|
|
Thats fine,
But I want to use entrance I don't like gdm |
|
Back to top |
|
|
ljgibson n00b
Joined: 06 Nov 2004 Posts: 9 Location: Florida
|
Posted: Sun Dec 19, 2004 3:13 am Post subject: |
|
|
I recently revisited the issue of xdm logins not being reported by the who command. I had previously tried placing sessreg commands into GiveConsole and TakeConsole, and experienced poor results and even worse problems. But after reading bug report no. 12767 (https://bugs.gentoo.org/show_bug.cgi?id=12767), and having forgotten of my previous failures, I again placed sessreg commands into GiveConsole and TakeConsole, identical to those shown in the bug report. My logins with xdm are now seen with the who command.
I don't know why this didn't work before; I had experienced rather catastrophic results. However, since that earlier trial I have replaced xorg version 6.8x with version 6.7. Perhaps that explains the difference in the results. |
|
Back to top |
|
|
ljgibson n00b
Joined: 06 Nov 2004 Posts: 9 Location: Florida
|
Posted: Sun Dec 19, 2004 3:24 am Post subject: |
|
|
RE:>>
I don't know why this didn't work before; I had experienced rather catastrophic results. However, since that earlier trial I have replaced xorg version 6.8x with version 6.7. Perhaps that explains the difference in the results.
<<
After pondering this a little more, I'm pretty sure that I did not enter the sessreg commands identical to those shown in the bug report in my previous attempts. I did not enter the '-h "" ' argument previously. |
|
Back to top |
|
|
30726 Veteran
Joined: 24 Sep 2003 Posts: 1501
|
Posted: Fri Mar 25, 2005 5:14 pm Post subject: |
|
|
I'm having the same problem, except that I'm not using any login manager (just startx), so none of the solutions in here works for me. I guess it happened when I upgraded xorg-x11, but I hadn't restarted X for over 60 days before I noticed it, so it's kinda hard to tell exactly when the problem arouse. |
|
Back to top |
|
|
30726 Veteran
Joined: 24 Sep 2003 Posts: 1501
|
Posted: Fri Apr 29, 2005 10:19 am Post subject: |
|
|
Still not solved. |
|
Back to top |
|
|
deno Guru
Joined: 13 Sep 2006 Posts: 411
|
Posted: Sun Oct 01, 2006 5:24 am Post subject: |
|
|
I have the same problem, but only if I log into kde over entrance. |
|
Back to top |
|
|
keyser_soze Apprentice
Joined: 19 Oct 2004 Posts: 162 Location: Australia
|
Posted: Sun Oct 01, 2006 8:31 am Post subject: |
|
|
I never solved this problem.
KDM and GDM add the user loggin in as part of thier log in process.
XDM does also. It has been a long time since i fiddled with this problem.
I am not sure how to do it with entrance. _________________ The greatest trick the devil ever pulled was convincing the world he didn't exist. |
|
Back to top |
|
|
|