Re: questions about applets gdm and su




If this was answered earlier, sorry for the duplication.

All display managers set up the X authority access control mechanism
which uses special values called "keys" or "cookies" to negotiate
access to the X server.  When you su, you need to forward the keys
to the root user.

There are at least two ways to do this (besides doing it completely
manually).  In Red Hat Linux 6.0, we have the pam_xauth module
which automatically forwards keys when the su application is
called, and removes them when appropriate.  This works transparently,
and is configurable -- if you have Red Hat Linux 6.0, just do
man pam_xauth to learn more about it.

Alternatively, you can just put code like this in root's .profile
(or equivalent startup script):
       if [ -n "$DISPLAY" -a -n "$LOGNAME" -a "$LOGNAME" != root ]
       then
           su -c $LOGNAME xauth -iq nextract - "$DISPLAY" | \
               xauth nmerge -
       fi

I hope this helps,

michaelkjohnson

"Magazines all too frequently lead to books and should be regarded by the
 prudent as the heavy petting of literature."            -- Fran Lebowitz
 Linux Application Development       http://www.redhat.com/~johnsonm/lad/


Johannes =?iso-8859-1?Q?H=F6lzl?= writes:
>cyberclay wrote:
>> 
>> Hey,
>>   I installed a few new applets and I'm having trouble executing them.
>> After the installation of netleds_applet, for example, I found it in
>> the applet menu but when I click on it nothing happens.
>>   Another question..normally I can switch to virtual console number
>> one to see what errors have occurred (if I startx in virtual console
>> number one).  Now, I'm using gdm and I don't know how to see the
>> errors. . . is there a program that will let me do this?
>>   If I open a gnome terminal as a normal user and then su to root
>> (by typing "su -") I can't run any x-windows programs..they all
>> give me this error:
>> Error: Can't open display:
>> 
>>   Pleasehelpme.
>> 
>> Regards,
>>   cyberclay
>> ---
>> cclay at fastlane dot net
>> http://www.abednego.com
>> 
>
>I'm using the KDE Display Manager, but I think in GDM it is the same
>problem.
>
>You can only run a X-programm as the login user. It is not possible to
>access the display as an other user.
>
>
>Greetings,
> Johannes Hoelzl
>
>
>-- 
>        FAQ: Frequently-Asked Questions at http://www.gnome.org/gnomefaq
>         To unsubscribe: mail gnome-list-request@gnome.org with 
>                       "unsubscribe" as the Subject.
>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]