PDA

View Full Version : Xlib: connection to ":0.0" refused by server



LeManu
05-12-2004, 10:05 PM
HI all,

Just installed 3.4 on HD (Debian mode).
Using my user account from a shell, I can open nedit, kwrite or any xwin app.
But when I try to open the same apps from the same shell as su
I got the following errors:


Manu@Knoppix34:~$ su
Password:
root@Knoppix34:/home/Manu# nedit
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
NEdit: Can't open display
root@Knoppix34:/home/Manu#



Any suggestions ! :(

Tks

Markus
05-12-2004, 10:45 PM
There's probably better ways to do this but this should work:
ln -s /home/Manu/.Xauthority /root/.Xauthority
AFAIK the error is due to xserver only allowing one connection at a time which isn't a bad thing.

EDIT: Do first as root:

cd ~
mv .Xauthority .XauthorityOLD

That way you can get the old file back if it doesn't work.

LeManu
05-13-2004, 09:00 PM
Thanks a lot. That worked :D

jvmiro
05-19-2004, 03:21 AM
Hi,
I've just gone through the same process, intalling 3.4 in HD, and had the same problem. I've fixed it as indicated, but I believe the limitation of allowing only one user connection to the xserver is not a very practical one. It is very often the case you need root privileges whilst being and ordinary user. Sudo will do that, but I find a new shell as root being more flexible.
I come from Red Hat, this is my first contact with Knoppix(and Debian), and while it's worked out of the box, I find that limitation a bit too restricting (and very little documented, being such an every day taks).
The solution given works, but as suggested I believe it is very precarious. Is there no "nicer" way of doing these things?
Ta
Jaime

pulsar
05-19-2004, 09:11 PM
I'm relatively new in linux and also encountered this. I found out you could do (in case of LeManu), as user:
'kdesu nedit'
after you type in your root pwd. you automaticaly enter nedit.

Markus
05-19-2004, 09:31 PM
Yes well, this workaround was actually for using a root shell which I prefer. As I said there's bound to be a better solution but I was too lazy to google for it as this works.
I don't really know why this was changed other than improving security so that if someone hacks into your computer they can't run things on your desktop.

Bleim
05-20-2004, 12:37 PM
I have the same problem BUT i don't have .Xauthority file at my HD!

Markus
05-20-2004, 04:43 PM
I have the same problem BUT i don't have .Xauthority file at my HD!
Is this a debian style install?
If yes do as user:

cd ~
ls -la .Xauthority
The file is hidden so you need the "a" when listing.

For a knoppix style install I can't help, never done it.

Bleim
05-20-2004, 07:06 PM
sorry, I forgot say that I have beginner debian instalation on HD (i don't know what's the diferrence between beginer and clasical debian mode), but I have the same problem!

Markus
05-20-2004, 10:19 PM
AFAIK beginner or knoppix style install basically copies over the files from cd to hd and uses lilo or grub to boot it. So that on each boot you get hardware autodetection etc. A debian style gets you an easy way to get a real debian OS with a real easy installer, a few odd scripts are different like sysvinit. But as I said, I've never done a beginner or knoppix install so I might be way off base here.
You can still look for the .Xauthority file, search with find, whereis or "locate .Xauthority". If you get "database more than 8 days old" do as root "updatedb".