SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
For some reason emacs won't work as root user in kde. This has always been a problem, but as I don't normally use kde, I've never solved it. It launched fine as a normal user. As root user user I get this error:
/home/simon# emacs /etc/lilo.conf
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.
I don't have this problem unless I'm running kde, so it must be something to do with that. kde also seems to mess about with other settings, such as mouse pointer buttons, but I've solved that. I can run it like this:
emacs -nw
But not otherwise. In what way does kde affect the display setting? Also, I'm now using run level 4 instead of 3, so it might be kdm doing this.
Trying to add root via xhost isn't working. /home/simon# xhost + root
No protocol specified
xhost: unable to open display ":0.0"
What I'm wondering is, why this is happening. I can't be the only person who uses emacs as root user in kde, and the kdm login manager. I'm pretty sure it's to do with kdm.
I think that display managers use the .Xauthority file. You could probably change that using the merge command option of xauth. But I would just try entering:
Thanks, kdesu does work. This is one of the reasons I don't use kde.
Now this kind of suggests that you're actually working as
your normal user, and were trying to open a GUI program
from a terminal after you've su-ed to root. If this is the case
ALL GUI tools should be giving you the same error message.
It's not a KDE fault, just a common security feature.
Well, no. Under KDE kdesu is indeed the proper way of doing that.
Under fluxbox you'd have to do the (last time I did it worked) a
"xhost +localhost:root" as your OWN user, and then in the terminal
you're in as root a "export DISPLAY=localhost".
Personally for system related editing I use vi these days ;} (and used
to use emacs -nw in the past - no point in getting used to GUI when
half the time you're doing it via ssh over bad lines ;D).
In fluxbox I always su to root. I didn't need to export the display, although su- didn't work as expected. It only seems to affect emacs. Vim works fine.
The difference between 'su' and 'su -' (which is probably what you'd want
when becoming root) is that su will preserve your environment - hence no
need to export anything - while 'su -' will create roots environment, and
the need for the exporting of DISPLAY.
I see, so it is kdm that is causing it. I'll use emacs -nw, or kdesu then, if I stick with kde. I thought I'd just try it as I haven't used it in a while. The auto mounting is nice. Thanks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.