Problem :
I have a strange problem:
In a GUI session, depending on the terminal being used the following two (related) problems appear:
who
andw
doesn’t list the user’s active sessionlogname
returnslogname: no login name
It happens in the following terminals:
- lxterminal
- xfce4-terminal
- rxvt
On the other hand, in the following scenarios it works perfectly (who/w lists the user and logname functions):
- ssh-ing in
- xterm / lxterm / uxterm
Solution :
Check whether lx, xfce, and rxvt are setuid root. If they are not, but xterm is, try setting them setuid root (which rxvt|xargs chmod u+s
). Per this:
rxvt tries to write an entry into the utmp(5) file so that
it can be seen via the who(1) command, and can accept mesĀsages.
To allow this feature, rxvt must be installed
setuid root on some systems.
“utmp” is /var/tmp/utmp
, which lists currently logged-on users. (This describes a related problem in which the values in utmp were not properly updated.)