LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-09-2005, 03:24 AM   #1
swan2925
Member
 
Registered: Apr 2005
Posts: 37

Rep: Reputation: 15
Xlib: connection to ":0.0" refused by server


I am running SuSE v9.2 FTP DVD version.

Quote:
swan@itscpc178:~> su
Password:
itscpc178:/home/swan # yast2
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

y2controlcenter: cannot connect to X server :0.0
itscpc178:/home/swan # exit
swan@itscpc178:~> /sbin/yast2
What should I config, in order I could run these X programs when I "su"?

I would be very grateful if I could receive your favorable reply.

Thanks!!
 
Old 06-09-2005, 08:43 AM   #2
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,694

Rep: Reputation: 45
either use 'sux -' instead of 'su' or enter 'xhost +localhost'
 
Old 06-09-2005, 08:45 AM   #3
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,176

Rep: Reputation: 54
As normal user, you can run:
Code:
xhost local:root
and then root will be able to open x programs. You can edit /root/.bashrc and add the following line:
Code:
export XAUTHORITY=/home/name/.Xauthority
Where "name" is the user account name that you use. After editing /root/.basrc, you won't have to issue the command "xhost local:root" anymore after X starts.
 
Old 06-09-2005, 09:39 AM   #4
swan2925
Member
 
Registered: Apr 2005
Posts: 37

Original Poster
Rep: Reputation: 15
Thanks very much for you guys kind help!!!
 
Old 02-16-2007, 08:01 AM   #5
jcconegundes
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Rep: Reputation: 0
Unhappy

I don't have /root/.bashrc (nor /home/root/.bashrc). I'm using Debian etch. What could I do?
 
Old 02-16-2007, 08:11 AM   #6
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,176

Rep: Reputation: 54
Are you looking as root user? First "su" to become root. Try this:
Code:
su
nano /root/.bashrc
Do you see any text there from the .bashrc file?
 
Old 02-16-2007, 09:09 AM   #7
jcconegundes
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Rep: Reputation: 0
Unhappy

I'm sure.

code:
$su
#cd /root
#ls .bashrc
ls: .bashrc: Arquivo ou diretório não encontrado

The fouth line means: "File or directory not found".

Thanks for the trying.
 
Old 02-16-2007, 09:20 AM   #8
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Install sux like rshaw said a year ago
 
Old 02-16-2007, 05:25 PM   #9
jcconegundes
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Rep: Reputation: 0
Thumbs down

Sux is already installed.

Code:
#apt-get install sux
Lendo lista de pacotes... Pronto
Construindo árvore de dependências... Pronto
sux já é a versão mais nova.
0 pacotes atualizados, 0 pacotes novos instalados, 0 a serem removidos e 184 não atualizados.
(in the fourth line apt says that sux is in its newest version)

And when I try:

Code:
# xhost +localhost
I get

Code:
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
xhost:  unable to open display ":0.0"
and also

Code:
$ xhost +localhost
localhost being added to access control list
$ su
# emacs
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
emacs: Cannot connect to X server :0.0.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.
The trick wich alway works well, but just till I reboot, is

Code:
cp /home/jcconegundes/.Xauthority /home/root

Last edited by jcconegundes; 02-16-2007 at 05:38 PM.
 
Old 02-16-2007, 07:23 PM   #10
jcconegundes
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Rep: Reputation: 0
Thumbs up

I added

Code:
export XAUTHORITY=/home/regular_user/.Xauthority
in /etc/profile. And now, it works even if I reboot.

That was not a clean work, I think. Any better sugestion?
 
Old 05-13-2007, 03:31 PM   #11
kiel2155
LQ Newbie
 
Registered: Feb 2007
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by m_yates
As normal user, you can run:
Code:
xhost local:root
and then root will be able to open x programs. You can edit /root/.bashrc and add the following line:
Code:
export XAUTHORITY=/home/name/.Xauthority
Where "name" is the user account name that you use. After editing /root/.basrc, you won't have to issue the command "xhost local:root" anymore after X starts.
Thanks for the help!
 
Old 07-17-2007, 12:16 PM   #12
mmodem
LQ Newbie
 
Registered: Aug 2003
Location: Portugal
Distribution: Mandriva
Posts: 21

Rep: Reputation: 15
Quote:
Originally Posted by m_yates
As normal user, you can run:
Code:
xhost local:root
and then root will be able to open x programs. You can edit /root/.bashrc and add the following line:
Code:
export XAUTHORITY=/home/name/.Xauthority
Where "name" is the user account name that you use. After editing /root/.basrc, you won't have to issue the command "xhost local:root" anymore after X starts.
This is only good when running from a shell.

In /etc/profile i do have a line with:
export XAUTHORITY=/home/name/.Xauthority[/CODE]

but when i run konqeror as root (and is runned by clicking in the konquerorsu icon in kmenu), when double clicking in a text file, i get this error:

KDEInit cant launch 'kwrite'.

So i continue to have to run in a console "xhost local:root".

How am i gona solve this permanently? Add "export XAUTHORITY=/home/name/.Xauthority" to /etc/etc/rc.d/rc.local ?

Isnt there a better solution?
 
Old 10-24-2007, 11:12 AM   #13
mklose
LQ Newbie
 
Registered: Jun 2007
Posts: 2

Rep: Reputation: 0
Talking Partly Worked

Quote:
Originally Posted by kiel2155 View Post
Thanks for the help!
Thank you very much for sharing the solution
but only the command part worked for me. I have to issue the command every time I start thunderbird.
 
Old 10-24-2007, 02:47 PM   #14
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Even simpler:
Link to the current correct cookie

$ su -
type your password
# ln -s /home/user/.Xauthority
 
Old 11-18-2007, 01:20 AM   #15
fitzhugh
LQ Newbie
 
Registered: Jun 2006
Location: Berkeley
Distribution: Puppy Linux
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by jcconegundes View Post
I don't have /root/.bashrc (nor /home/root/.bashrc). I'm using Debian etch. What could I do?
in case you return to read this and are not yet clear: just add /root/.bashrc
You can create it with just that one line that was suggested for this problem:
Code:
export XAUTHORITY=/home/name/.Xauthority
or you can add other commands, aliases etc. that you might want to have as well. Check out http://www.faqs.org/docs/abs/HTML/files.html for information on what this and the related files do. Basically they are where you configure systemwide [/etc/.bashrc and /etc/.profile] and user-specific [$HOME/.bashrc and $HOME/.bash_profile] functions and aliases (for bash shell only).

This means you, as the administrator of your computer, get to decide what all goes in them. Typically, users would decide what goes in their own $HOME/.bashrc and $HOME/.bash_profile - most likely that is also you. My main point is that they are there for your convenience, rather than being some untouchable and necessarily mysterious file of the "us mortals shall not touch" category.

This link explains more clearly the difference between these different files: http://www.linuxquestions.org/questi...bashrc-273992/

Note: $HOME refers to your home directory, for example it might be /home/kiel2155/.bashrc

Hope this helps.
Fitzhugh
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Xlib: connection to ":0.0" refused by server Xlib: No protocol specified eyalkz Linux - Newbie 10 02-07-2014 12:53 AM
XERROR: 'Xlib: connection to ":0.0" refused by server' tsiMental Debian 11 02-16-2007 07:30 PM
Xlib: connection to ":0.0" refused by server Xlib: No protocol specified eyalkz Programming 1 03-02-2004 08:22 AM
Wine not working. Xlib: connection to ":0.0" refused by server Xerop Linux - General 1 02-18-2004 09:37 PM
What is "Xlib: connection to ":0.0" refused by server " rack201 Linux - Software 1 02-04-2004 07:49 AM


All times are GMT -5. The time now is 12:14 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration