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

Top Page
Author: Hugo Mills
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] GUI editor as root in Etch running KDE

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x5716f100.hantslug.org.uk.19561': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Thu Mar 29 15:35:08 2007 BST
gpg: using DSA key B2C27BC21C335860
gpg: Can't check signature: No public key
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.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 1C335860 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
    --- Most administrators wouldn't give their users the time of ---    
                      day.  That's what NTP is for.