Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
This one has me stumped. I am on SuSE 9.0 Pro w/ KDE Everything works fine as root and as a user. The problems happen when I am logged on as a user and su - to root from the terminal and try to run a gui-application from the command line. Each app gives me a different error, but they all relate to "not able to open display" How can I run a gui-app as root when logged in as a user?
Just so you know, "xhost +" removes all security restrictions for who can create windows on your desktop, while "xhost + localhost" supposedly allows anyone from the same computer to create windows on your desktop, according to "man xhost".
With my old setup of "xhost +", it was working but giving error messages only when root ran GUI applications. Now, on your suggestion, I added localhost and it gives error messages and doesn't even run the application. The error messages I got when trying to run Konqueror was:
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
konqueror: cannot connect to X server :0.0
Are you sure (all) you're supposed to do is run "xhost + localhost" as the normal user and set DISPLAY=:0.0 for root?
connection refused can mean that
a) sshd isn't running
b) sshd is configured to deny logins from root
c) localhost is not in /etc/hosts
d) a firewall isn't set-up correctly
Yeah, it's a). My /etc/hosts does have localhost set up correctly.
Here's something to think about: why do I have to check which of the 4 alternatives is the case? Why can't the program tell me?
People usually think of user-friendliness as meaning an intuitively designed graphical user interface. But specific error messages are a very important part of a user-friendly program too, and they're a part that's usually ignored.
Because (in this particular case) the program is
designed to be run against remote machines,
and it's in the nature of that that it can't determine
the reason for the failure to connect ;}
Actually, yeah, I see what you mean for this case. I think it still could have a special case for when you're trying to connect to this computer - it could do some extra checks to see what's wrong. But then the program would be getting TOO smart I suppose.
Still, how about if it had a nice error message like this:
ssh: could not connect to port 22 of the computer "localhost" because "localhost" wouldn't let me. This may have a variety of causes but is probably the fault of "localhost".
ssh would be the safest easy way.
If the machine is multiuser people could
play tricks on you by opening stuff in
your session if you have xhost +local
(or localhost, for that matter) enabled.
I have seen scripts (run by root) that
modify the targets .Xauthority file, which
will give root the right to open X apps
in the target users session.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.