View previous topic :: View next topic |
Author |
Message |
afrodocter1 n00b
Joined: 16 Jan 2007 Posts: 49
|
Posted: Thu Nov 08, 2007 2:17 pm Post subject: run x programs as root. |
|
|
i am trying to run x programs as root under a normal user's X-session. i get the following.
Code: | xterm
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s
xterm: DISPLAY is not set |
when i am su into root and the same when i sudo xterm
Code: | sudo xterm
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s
xterm: DISPLAY is not set |
i have tried
Code: |
xhost +
xhost +localhost
|
and it does not help. now xhost yields.
Code: | xhost
access control disabled, clients can connect from any host
INET6:localhost
INET:localhost
|
|
|
Back to top |
|
|
di1bert l33t
Joined: 16 May 2002 Posts: 963 Location: Oslo, Norway
|
Posted: Thu Nov 08, 2007 2:27 pm Post subject: |
|
|
It's probably your DISPLAY environment variable. Do echo $DISPLAY as your
normal user and then export that output as root
eg:
Code: |
export DISPLAY=":0.0"
|
That should do it, along with the xhost stuff...
HTH
-m |
|
Back to top |
|
|
afrodocter1 n00b
Joined: 16 Jan 2007 Posts: 49
|
Posted: Mon Nov 12, 2007 5:10 pm Post subject: |
|
|
the problem was that i used
instead of
Code: |
export DISPLAY=":0.0"
|
although i still get an error if i using the following set up, which i think should work.
Code: |
> xhost -
access control enabled, only authorized clients can connect
> xhost +localhost
localhost being added to access control list
> sudo su
dong alex # echo $DISPLAY
localhost:0.0
dong alex # xterm
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s
|
|
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Mon Nov 12, 2007 6:47 pm Post subject: |
|
|
See this thread.
Or this one.
or this one,
or this one (which also mentions why sudo su is wrong),
or this one,
or even this.... _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
think4urs11 Bodhisattva
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Mon Nov 12, 2007 7:00 pm Post subject: |
|
|
Moved from Desktop Environments to Duplicate Threads.
for alternatives see above _________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
|
|