View previous topic :: View next topic |
Author |
Message |
cayenne l33t
Joined: 17 Oct 2002 Posts: 945 Location: New Orleans
|
Posted: Thu Jun 24, 2004 2:56 am Post subject: Can't run X app (k3b) while su'ed as root... |
|
|
Hi all,
I recently upgraded my kernel to 2.6, and KDE to 3.2. It seems now, that while as my normal user, but, su'ed into root, I can no longer run x applications.
As my local user, I did xhost +localhost. However, when I try to run a program as root, I get the following error:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
k3b: cannot connect to X server :0
[1]+ Exit 1 k3b
Any ideas what I'm doing wrong here?
TIA,
cayenne _________________ Light travels faster than sound. This is why some people appear bright until you hear them speak......... |
|
Back to top |
|
|
Shan Guru
Joined: 04 Nov 2003 Posts: 558 Location: /dev/null
|
Posted: Thu Jun 24, 2004 3:04 am Post subject: |
|
|
You've got to run it as yourself, with root privs. Try this instead
Please note -c stands for command
also note the BACKTICS (not quotes). You'll be asked for the root password, and then the program should execute. _________________ { NO -U } { STRIP }
{ TINY } |
|
Back to top |
|
|
Plastic l33t
Joined: 24 Mar 2004 Posts: 649
|
Posted: Thu Jun 24, 2004 4:52 am Post subject: |
|
|
Run
before you su |
|
Back to top |
|
|
Shan Guru
Joined: 04 Nov 2003 Posts: 558 Location: /dev/null
|
Posted: Thu Jun 24, 2004 5:02 am Post subject: |
|
|
Plastic wrote: | Run
before you su |
You could put this in your .bashrc or such too if you wanted it to be persistent right? Though it would probably invalidate whatever reason they had to make it currently prevent root from launching X apps eh? _________________ { NO -U } { STRIP }
{ TINY } |
|
Back to top |
|
|
Rafixus n00b
Joined: 06 Jan 2003 Posts: 67
|
Posted: Fri Jun 25, 2004 5:55 am Post subject: |
|
|
For temporary X usage from root, you could also
Code: |
cp /home/<your user>/.Xauthority /root
|
then you can run all the needed apps as root and X won't complain |
|
Back to top |
|
|
soujirou Apprentice
Joined: 22 Jun 2004 Posts: 205 Location: sweden
|
Posted: Fri Jun 25, 2004 11:18 am Post subject: |
|
|
im trying to run xscreensaver when im root
it starts if i use xhost local:root but when im in it it pops up an dialog "couldnt write /root/.xscreensaver" how do i fix this ? |
|
Back to top |
|
|
Shan Guru
Joined: 04 Nov 2003 Posts: 558 Location: /dev/null
|
Posted: Fri Jun 25, 2004 11:55 am Post subject: |
|
|
Maybe Im mis-interpreting what your saying but why are you logged into X as root? Its not neccisary and poses a large secuirty risk (as well as increases the danger of screwing up by a whole lot) _________________ { NO -U } { STRIP }
{ TINY } |
|
Back to top |
|
|
soujirou Apprentice
Joined: 22 Jun 2004 Posts: 205 Location: sweden
|
Posted: Fri Jun 25, 2004 12:09 pm Post subject: |
|
|
........................ well yes... didnt solve the problem though |
|
Back to top |
|
|
Shan Guru
Joined: 04 Nov 2003 Posts: 558 Location: /dev/null
|
Posted: Fri Jun 25, 2004 12:25 pm Post subject: |
|
|
soujirou wrote: | ........................ well yes... didnt solve the problem though |
My point was to AVOIDE the problem all together. Maybe your new to the Linux world and don't realize this, but running as root (especially as in an X environment) is a Bad Thing(TM) and should be avoided at all costs.
Use "su -" or "sudo" instead, both methods allow you to run x apps as well. _________________ { NO -U } { STRIP }
{ TINY } |
|
Back to top |
|
|
soujirou Apprentice
Joined: 22 Jun 2004 Posts: 205 Location: sweden
|
Posted: Fri Jun 25, 2004 12:33 pm Post subject: |
|
|
okej |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
|
Back to top |
|
|
|