Q: easy su

LHartung list at ioscan.de
Mon Aug 28 18:58:32 BST 2006


D. R. Evans schrieb:
> I get very fed up of typing my silly password all the time when I'm
> doing admin type stuff.
>
> How does one get "su" to work the way it has historically done in *NIX
> (and does work in Mdv and other distros I've tinkered with over the
> years)?
>
> I have a password assigned to root, and can easily get to be the
> super-user by typing "su" and the root password. But once I am root I
> can't edit anything, because when I try to run emacs, here's what
> happens:
>
> -----
>
> [H:~] su
> Password:
> root at homebrew:/home/n7dr# emacs
> Xlib: connection to ":0.0" refused by server
> Xlib: No protocol specified
>
> emacs: Cannot connect to X server :0.0.
> Check the DISPLAY environment variable or use `-d'.
> Also use the `xhost' program to verify that it is set to permit
> connections from your machine.
>
> root at homebrew:/home/n7dr#
>
> -----
>
>   
Hi,

this has nothing to do with su, you have to allow the root user to 
connect to your X-Server.
The X-Server is running under your normal user.


First you should allow localhost to connect to your x-server. Under your 
normal user use

xhost localhost

to allow connections.

Now use su to switch to root user
You should then set your DISPLAY variable: 

export DISPLAY=:0.0

if its not set.

Now emacs should work.

Another way is to use ssh with PublicKey Authentication and X11 
Forwarding. In that way i do not have to type password.


Lars

-- 

http://www.lhits.eu
http://www.linuri.de




More information about the kubuntu-users mailing list