LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Unable to run a GUI app as root using su? (https://www.linuxquestions.org/questions/linux-general-1/unable-to-run-a-gui-app-as-root-using-su-326868/)

vharishankar 05-25-2005 03:13 AM

Unable to run a GUI app as root using su?
 
I am using KDE and I always log in as a user. However, there are times when I must run my editor Quanta as root (so that I can directly save files in the /var/www folder rather than go through the trouble of saving them in /home/hari and then copying them to /var/www

For this I always used to run su from a terminal window and then run the application.

After quite a while now, I again tried to run Quanta as root.

Code:

su
Password: *********
quanta &

I get this error:
Code:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

quanta: cannot connect to X server :0.0

What could be the reason for this sudden problem? I changed no config files as far as I know and I am in KDE.

This may have something to do with upgrading su and the config file. If anybody knows how to fix this, I would be grateful for an answer.

slackie1000 05-25-2005 03:18 AM

hi there,

something called "xhost +" ...
you need to be allowed to export the display...
before su do the following
Code:

xhost +
and after su...
Code:

export DISPLAY=$HOST:0.0
regards
slackie1000

vharishankar 05-25-2005 03:22 AM

Thanks slackie1000. This works.

Are these options volatile? Will it work after a reboot or must I execute them again?

slackie1000 05-25-2005 03:29 AM

hi there,
nope.. you need to execute again..
but i think, somewhere , somehow, you can make it standard. .. but this is out of my knowledge. sorry.
regards
slackie1000

vharishankar 05-25-2005 03:32 AM

The big mystery is that it worked earlier without this. It is only recently that it has given me that error.

So it must be a config file issue. Anybody?

bathory 05-25-2005 03:46 AM

You can always press Alt-F2 to bring up the "run application" pop-up prompt. Fill-in quanta and check the option to run as a different user (root). You can also check the option to remember the root password.

vharishankar 05-25-2005 08:01 AM

Quote:

Originally posted by bathory
You can always press Alt-F2 to bring up the "run application" pop-up prompt. Fill-in quanta and check the option to run as a different user (root). You can also check the option to remember the root password.
This is a good workaround. Thanks. It works.

In the meantime if anybody can suggest a solution to the first problem (regarding su), I'd be very grateful.

vharishankar 05-25-2005 08:08 AM

I used kdesu anyway and created a shortcut on the desktop.

Thanks for all suggestions :)


All times are GMT -5. The time now is 09:22 PM.