Problems running editors

If none of the more specific forums is the right place to ask

Problems running editors

Postby oren » 2006-07-20 23:34

I am trying to edit my sources.list but when I issue as su:
"kate /etc/apt/sources.list" I get the following:
QPixmap: Cannot create a QPixmap when no GUI is being used
QPixmap: Cannot create a QPixmap when no GUI is being used
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kded: cannot connect to X server :0.0
kded: ERROR: KUniqueApplication: Registering failed!
kded: ERROR: Communication problem with kded, it probably crashed.
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

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: No protocol specified

kate: cannot connect to X server :0.0
kate: ERROR: KUniqueApplication: Registering failed!
kate: ERROR: Communication problem with kate, it probably crashed.


When I try - the same with kwrite I get:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kwrite: cannot connect to X server :0.0


Both applications will start fine from the KMenu.

Any ideas?
oren
 
Posts: 30
Joined: 2006-07-16 21:32

Postby Lavene » 2006-07-20 23:43

Code: Select all
apt-get install sux

Then use 'sux' instead of 'su'. This will allow you to run X apps as root without messing with permissions etc.

Tina
Lavene
Site admin
 
Posts: 5096
Joined: 2006-01-04 04:26
Location: Oslo, Norway

Postby oren » 2006-07-21 06:50

Thanks Tina!
Worked as you said!

How would you sort this out properly though?
I did not realise this was a permission issue....
oren
 
Posts: 30
Joined: 2006-07-16 21:32

Postby ajdlinux » 2006-07-21 07:52

As you may know, X is a server. Now of course you don't want just anyone connecting a program to your X server and putting random windows on your screen. The X 'magic cookie' which is used to authenticate your user to X is stored in ~/.Xauthority.

When you su, the Xauthority file doesn't copy over, and programs look in ~root/.Xauthority which won't work. What sux does is copy the .Xauthority file from ~user/.Xauthority to ~root/.Xauthority. There isn't really much you can do about it, it's there for security.
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

Postby oren » 2006-07-21 08:09

Aha!
This is a bit clearer to me now.
So, running sux should not pose any security issues as the user still need the root password right?

So potentially only a designated user, who knows the root password, can run sux.
Now, wouldn't it be easier to make a specific user a 'sudoer' and forget about the sux?

Or have I got the whole idea wrong?
oren
 
Posts: 30
Joined: 2006-07-16 21:32

Postby ajdlinux » 2006-07-21 09:08

When you log on, the X server authorisation file is created, which is placed in your (i.e. your normal user) home directory. root does not have this 'magic cookie' with the authentication token. So by default, only your user has access to the X server. su won't copy the file over to root's home directory; sux does.
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia


Return to General Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable