Re: [Hampshire] GUI editor as root in Etch running KDE

Top Page

Reply to this message
Author: Alex Phillips
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] GUI editor as root in Etch running KDE
Hugo Mills wrote:
> On Thu, Mar 29, 2007 at 03:24:53PM +0100, hantslug@??? wrote:
>
>> Let's get the flame wars out of the way first - yes, I know that many of you
>> prefer Gnome, and yes I know that Ubuntu is the solution to all ills, but
>> they are not the solution to what I want to do because I actually do want to
>> go to Dublin from here.
>>
>> How can I get a gui text editor running as root in Etch? Or is it simply
>> impossible and I have got to screw my courage to the sticking point and use
>> vi or vim? I would greet that solution with considerably less than
>> overwhelming enthusiasm.
>>
>
>
>> I tried to do what I usually do and run the editor from the command
>> line in a root session, but could not. Both Kwrite and Gedit
>> refused to run and returned the same error: basically, both
>> complained that xserver would not let them in. So I logged out and
>> tried to login again as root, but was told that I could not login as
>> root. I did not bother to try any other gui editor because it
>> seemed likely that they will all return the same error message. So
>> is the lesson I ought to be learning from this that I can't run GUI
>> apps as root in Etch?
>>
>
>    I'm running etch on this machine, and I can get a GUI editor
> running as root by doing simply:

>
> $ sudo emacs
>
>    If that fails, then:

>
> $ xauth list
>
> as the owner of the X session, then find the MIT-MAGIC-COOKIE-1 line
> for the <machine>/unix:0 connection. Copy this complete line to the
> clipboard. Then:
>
> $ su -
> # xauth add <copied line>
> # export DISPLAY=:0.0
> # emacs &
>
>    This will copy the private authentication token for the session,
> and give it to root. Then the export command sets up the environment
> so that any X apps started will try to connect to an X session.

>
>    Finally, if that fails:

>
> $ ssh -X root@localhost
> # emacs &
>
>    It's a horrible hack, but it works. :)

>
>    Hugo.

>
>

Or you could try this, which Hugo posted on the 16th of September 2003,
and I've used regularly since :-

I usually do this:

$ su -
# export DISPLAY=:0.0
# xauth merge ~hrm/.Xauthority

Where "hrm" is the user I'm using X as.

Hugo.


Regards,
Alex.