LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Root can execute programs (https://www.linuxquestions.org/questions/linux-newbie-8/root-can-execute-programs-139319/)

lawrencegoodman 01-27-2004 03:21 PM

Root can execute programs
 
Something wierd is going on with my root. When I log in as root, I can no longer executive programs.

For example, I type in /opt/kde3/bin/kate and get the following error:
kdeinit: Shutting down running client.
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
kded: cannot connect to X server :0.0
ERROR: KUniqueApplication: Registering failed!
ERROR: KUniqueApplication: DCOP communication error!
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
kdeinit: Can't connect to the X Server.
kdeinit: Might not terminate at end of session.
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
kate: cannot connect to X server :0.0
ERROR: KUniqueApplication: Registering failed!
ERROR: KUniqueApplication: DCOP communication error!

When I type in /opt/wp8/bin/xwp (for wordperfect), I get the following error:
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
Error: Can't open display: :0.0
linux:/opt/wp8/wpbin # ./xwp -admin
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
Error: Can't open display: :0.0

This must be a permissions problem, right? But how did I take away permissions from root?

Thanks

-X- 01-27-2004 03:31 PM

type
# set
in a command window and see what DISPLAY says. If it is gone then in a terminal window type;
# DISPLAY=:0.0
# kate
Your display may have gone south. If reboot doesn't fix it, put
export DISPLAY=:0.0
in some startup script.

Of course the '#' are in root's prompt. Do not type these.

alar 01-27-2004 03:36 PM

Maybe you have more than one session of X open.
How are you logging in as root?

Are you doing it from within x or
(and this is what it looks like)
have you jumped to a new console and tried to lauch an X program
from a terminal?

Also echo $DISPLAY
should be :0.0
or
machinename.hostname.com:0.0

From within X launch a terminal and su to root.
Should be ok from there.

Hope this helps,
alar

lawrencegoodman 01-27-2004 05:05 PM

Thanks, but no luck.

I type set as root and get:
DISPLAY=:0.0

When I type echo $DISPLAY, I get:
:0.0

Some other info if it helps:
1) I am logged in as lawrencegoodman. I open a terminal, do su, and then try to run kate and get those errors.
2) I can type ALT+F2 and type kdesu -- sudo kate and kate will start.
3) I can open up a new session, login as root, and then get kate to work.
4) One thing I have never understood: as a user, I can just type kate and kate will launch. But whenever I am root, I have to type ./opt/kde3/bin/kate or else it says it cannot find kate. I don't quite get why a user has access to the bin files, but not root.
5) I have been tinkering with my fstab folder and put in a usb cdrw device today. I don't see how that would cause this problem, but just in case.
6) I am using Suse 8.2 with KDE 3.1.

Thanks as always for all your help.
Lawrence

-X- 01-27-2004 07:06 PM

1) Look into vim, joe, pico when you su in a terminal.
4) When you type the set command after su, did you notice that /opt/kde3/bin was not in the PATH. When you type "su" and the password, you do not pickup the root's path. Try "su -" and the password. Yes that is a dash after su. The dash says to use root's path. If suse didn't setup a complete path as you would like, find it and add whatever you need. Every distro I've seen works correctly. Most folks when they "su" in a terminal use vim,joe,pico,etc...
5) You didn't cause any problems doing this. Maybe next time try vim,joe,pico, etc....
6) Good distro. Edit your profile and put suse in there like I have slackware in mine. Then it will show up on the left. Does suse have vim, joe, pico, etc...?

A little hint, some day you are going to have a GUI problem. You are not going to be able to use kate. You are going to have to use a non-GUI text editor. Every distro I seen has vim or vi, most have joe, pico, nano. Learn to use it/them (vim is the best choice), at least in bare bones mode. Doing things like working with fstab is a perfect place to start. vim has a GUI mode also. In terminal and under your name, type gvim and see if it is installed on your distro. It is a GUI version of vim. To be honest, vim is a little different that kate, somewhat tough to get your hands around it, but once you get working with it you should have no problem. You should have the docs. There is a tutor, type vimtutor. Check the web site or google.

-X- 01-27-2004 07:14 PM

One more thing. In your first post, I took it as you login as root, NOT using su from a terminal window. Try to give a little more details. Your second post should have been included in your first post. Two different things. Confuses the question.

good luck.

Shade 01-27-2004 07:30 PM

Responses in order:

1) Make sure the DISPLAY variable is set to :0.0 after you su. I get errors about not having DCOPserver running, but i'm not in kde and it allows me to start kate.
2) Using kdesu sets up proper communication between the required processes (dcopserver and others, i'd assume) which allows it to work. It's designed specifically for this purpose.
3) That's good, but not good to log into X as root :-D
4) Default paths are different for users and root. (for good reason.) echo $PATH to see the path as a user, then do su or su - or login as root and do the same to see the path for root.
5) fstab would have nothing to do with this :) and fstab is a file, not a folder.

For what it's worth, I'm using slackware and also cannot open kate from an xterm after su-ing.

Someone else will probably have more complete answers.

Does kdesu work from that xterm ? I'd imagine it would :-D

--Shade

FLOODS 01-27-2004 07:42 PM

I logged in under user and then used su. Tried to run kate and it worked fine. Didn't have to use /whatever/folder/to/kate, just typed in kate and it worked.. Said segmentation fault at start but kept going and worked fine.. logged out and under normal user worked better with no errors etc..

lawrencegoodman 01-27-2004 08:08 PM

Okay, you guys are a godsend. Thanks.

So I login as su - (with the dash), and then I can indeed now just go ahead and type kate, but I get this error:
ERROR: KUniqueApplication: Can't determine DISPLAY. Aborting.

I then type echo $DISPLAY and get nothing.

Finally, I type DISPLAY=:0.0 and try kate again, but get the error:
ERROR: KUniqueApplication: Can't determine DISPLAY. Aborting.

I also get this error:
Mutex destroy failure: Device or resource busy

And when I type konqueror, I get this error:
Xlib: connection to ":0.0" refused by server
Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison)
konqueror: cannot connect to X server :0.0

I guess it's a matter of reestablising for roor the path to DISPLAY. But, forgive me, I am not sure how to do that. I also was just wondering if you might explain how, in general, you set paths for a user, i.e. what file I can edit to make these settings permanent.

Thank you for the education.

stickman 01-27-2004 08:55 PM

Before you su to root, try "xhost + localhost" then set your DISPLAY variable as root.

lawrencegoodman 01-28-2004 07:09 AM

This works! Thanks. I am just wondering now how I make these settings permanent, i.e.
1) Is there a way I can do su and it remember the paths for su -?
2) How do I make is so xhost = localhost all the time?
3) How do I permenantly reset the path for display for root?

Thanks!

stickman 01-28-2004 07:42 AM

Put the commands in .profile.


All times are GMT -5. The time now is 07:22 AM.