You are not logged in.

#1 2008-01-14 12:58:38

Wilson Phillips
Member
From: Vicksburg, MS, USA
Registered: 2007-09-24
Posts: 70

Permissions/Ownership issue? [Solved]

Running KDE 3.5.8, I can open Konqueror, and click any text or openOffice fileand open it. Everything pretty much works as expected.

If I open File Manager - Superuser Mode, and try to open these same files, it fails with errors like <KDEInit could not launch 'kwrite'.>  I can open these files with nano from the konsole window, so I can tell that it only happens in KDE.

I did some searching and did not find anything that helped so far. Anyone have an idea where I should look?

Last edited by Wilson Phillips (2008-01-20 13:52:14)


Guarantee does not cover shark bite, bear attack, or children under 5.

Offline

#2 2008-01-15 11:11:59

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: Permissions/Ownership issue? [Solved]

Try to su to root in a terminal and then open the same document using "kwrite /home/user/bla.odf". If you get an error concerning $DISPLAY, use "xhost +" as a normal user and afterwards retry opening the document as root.


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#3 2008-01-15 12:42:31

Wilson Phillips
Member
From: Vicksburg, MS, USA
Registered: 2007-09-24
Posts: 70

Re: Permissions/Ownership issue? [Solved]

I get a No Protocol Specified error when I do that.

[root@deathstar wilson]# kwrite /home/wilson/.bashrc
No protocol specified
kwrite: cannot connect to X server :0.0

Same with .txt and .odt, but I can still use nano to edit these same files.


Guarantee does not cover shark bite, bear attack, or children under 5.

Offline

#4 2008-01-15 13:49:40

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Permissions/Ownership issue? [Solved]

As FUBAR said: this is perfectly normal. You try to run an app that is not meant to be run in an X environment, as root.

Either adjust your settings (e.g. with xhost) or learn to master nano/vi/emacs/whatever to edit stuff in a command line environment smile.

If you configure sudo the right way you might be able to use it to run kwrite and similar (graphical) apps with root powers.

Last edited by B (2008-01-15 14:01:24)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#5 2008-01-15 13:58:23

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Permissions/Ownership issue? [Solved]

kwrite: cannot connect to X server :0.0

root (as mentioned already) does not have (should not have) rights to run X apps

you can "fix" this by issuing as user from command line
#xhost +
this will disable temporary acls  (reboot will automatically reverse this or you can issue (again as user) #xhost - ) and root will be able to use X
next su to root and play with X

Last edited by broch (2008-01-15 13:59:09)

Offline

#6 2008-01-15 14:42:04

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: Permissions/Ownership issue? [Solved]

Dammit, listen to me!! tongue


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#7 2008-01-15 17:27:45

Wilson Phillips
Member
From: Vicksburg, MS, USA
Registered: 2007-09-24
Posts: 70

Re: Permissions/Ownership issue? [Solved]

Thanks guys. I will test this when I get home tonight.

I was not aware that root should not have the permissions to run X applications. I have been using openSUSE and it works there, so that was all I knew. smile


Guarantee does not cover shark bite, bear attack, or children under 5.

Offline

#8 2008-01-15 19:16:05

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: Permissions/Ownership issue? [Solved]

You can also use kdesu to run graphical apps as root:
$ kdesu kwrite

Offline

#9 2008-01-15 21:10:45

Wilson Phillips
Member
From: Vicksburg, MS, USA
Registered: 2007-09-24
Posts: 70

Re: Permissions/Ownership issue? [Solved]

I do use nano to edit files if I am in a console window, but if I am already in Konqueror's Superuser mode and can simply click on a file to open it in kwrite, I find that to be a time saver and a nice convenience.


Guarantee does not cover shark bite, bear attack, or children under 5.

Offline

#10 2008-01-16 00:41:34

Snork
Member
Registered: 2007-06-28
Posts: 11

Re: Permissions/Ownership issue? [Solved]

I've had the same problem.  Here's what I've found:

Started after upgrading to xorg-xinit-1.0.7-3 today.
I edit a file with vim, get "No protocol specified" message.
I see "... X: client 9 rejected from local host ..." messages ( I boot to level 3, login as a default user, then startx to X and fluxbox, then su - to other users.  The message is seen in the default user startx term. )
I can't open the display:
(firefox-bin:8400): Gtk-WARNING **: cannot open display: :0.0

[1]+  Exit 1                  /opt/mozilla/bin/firefox


xorg-xinit-1.0.7-3 has a new file: /etc/X11/xinit/xserverrc which has a single line:
exec /usr/bin/X -nolisten tcp

From previous experience I know that with my setup, this will prevent me from opening Firefox, etc.

As broch said, xhost+ will "fix" it.  I was using xhost +localhost, but that no longer works.

Overall, this is a better setup, as netstat -tap no longer shows any X listeners.  And I have shorewall running on the box.  Still I'd like to find something a little less "blunt force" than xhost+.

Snork


I don't want to be the Go-To Guy.  I want to be the Go-Past Guy.  He's
        the guy you rush past on your way to bother the first guy.
                Me, 08/05

Offline

#11 2008-01-16 02:09:00

Wilson Phillips
Member
From: Vicksburg, MS, USA
Registered: 2007-09-24
Posts: 70

Re: Permissions/Ownership issue? [Solved]

FUBAR wrote:

Try to su to root in a terminal and then open the same document using "kwrite /home/user/bla.odf". If you get an error concerning $DISPLAY, use "xhost +" as a normal user and afterwards retry opening the document as root.

I was not getting the $DISPLAY errors, but yes, xhost + worked and then I could open kwrite from the command line. I can also open items in kwrite from konqueror. Thanks for the answer.

Snork wrote:

Still I'd like to find something a little less "blunt force" than xhost+.

Same here. This seems like a bit of overkill. I would prefer to allow root without allowing everyone.

Last edited by Wilson Phillips (2008-01-16 02:10:00)


Guarantee does not cover shark bite, bear attack, or children under 5.

Offline

Board footer

Powered by FluxBB