LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 02-25-2006, 02:50 PM   #1
xucaen
Member
 
Registered: Feb 2004
Location: Boston
Distribution: Kubuntu 22.04
Posts: 101

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


Hi, I am running Debian testing on my home PC with kernel 2.6.7-1-k7.
yesterday I started playing with xterm. I run X with my user, in my .bashrc I set TERM=xterm-color and in KDE I can run xterm with no problem. However, I have another user named bbs, and I set up that user with the exact .bashrc (I copied it and chown bbs:bbs). Now, when I set TERM=xterm-color and I su bbs, whenever I run vim to edit a file I get Xlib: connection to ":0.0" refused by server.
But, here the funky thing about it. When I set TERM=linux, I don't get the error in vim! It only happens when I set TERM=xterm-color. I don't understand this. Does anyone here have any experience with this? I've done searches on google for this error and they claim it has something to do with .Xauthority, but I don't think so and here's why. As a test, I deleted /home/bbs/.Xauthority and I shut down X. Then I logged back in as user bbs and ran startx. .Xauthority got generated, and xterm does not give any errors even when I set TERM=xterm-color!

Why does su bbs give errors, but loging in as user bbs not?

This is strange stuff. Any ideas are welcome.

Thanks!!

Jim
 
Old 02-25-2006, 02:53 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
One easy fix that might work:
Quote:
xhost +
before you "su" as the bbs user.
 
Old 02-25-2006, 04:51 PM   #3
dracae
Member
 
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423

Rep: Reputation: 30
xhost + is evil, install sux
 
Old 02-25-2006, 07:40 PM   #4
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
In general, dealing with X tends to be difficult. IMO, GNU/Linux makes a great server OS, and I use Debian for this whenever given the chance. But when you try to use it as a desktop, you run into walls that haven't quite been smoothed over yet by time and the community. They may never get smoothed over. Dunno. That's not too bad a thing though -- maybe we'll have Syllable ( http://www.syllable.org/ ) before long for desktop use instead.

Anyway, X is one of these walls. My procedure in dealing with it has always been: keep the setup as simple as possible, and let systems like dpkg-reconfigure do as much of the work for you as possible.

There are various instructions on the web that might help you, including:

1.using the xhost command: "xhost +local:bbs", or

2. using "xhost +localhost", or

2. running "export XAUTHORITY=/home/bbs/.Xauthority" (as which user I do not know). Maybe you can put that line in the relevant user's .bash_profile. Or,

3. export DISPLAY=:0.0 if that variable's not already set.

I don't understand exactly what they all do, but I've run them in the past and if you simultaneously stand on one leg with a macaroni strainer on your head and howl at a full moon while you execute them, they may also work for you.

Last edited by johnMG; 02-25-2006 at 07:44 PM.
 
Old 02-25-2006, 09:57 PM   #5
xucaen
Member
 
Registered: Feb 2004
Location: Boston
Distribution: Kubuntu 22.04
Posts: 101

Original Poster
Rep: Reputation: 16
Hi, I tried xhost local:bbs and that seemed to work.

Thanks guys!

Jim
 
Old 02-26-2006, 12:41 PM   #6
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by johnMG

2. running "export XAUTHORITY=/home/bbs/.Xauthority" (as which user I do not know). Maybe you can put that line in the relevant user's .bash_profile. Or,
You put it in the /root/.bashrc then when you su to root the file is read and the Xauthority is used from the user who did the su of course the /home/bbs in the line above has to be changed to the actual username of the user doing it.
 
Old 02-26-2006, 12:57 PM   #7
dracae
Member
 
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423

Rep: Reputation: 30
apt-cache search sux
sux - wrapper around su which will transfer your X credentials
 
Old 02-27-2006, 01:58 AM   #8
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
Stephen, thanks for adding that note there. I just dug around and checked
my personal notes on using X, and found that there was a line there about
.Xauthority -- describing just as you did above -- saying "I am quoting
happytux on that one." I haven't touched that doc in way over a year! So
thanks.
 
Old 03-02-2006, 07:17 AM   #9
coyopil
Member
 
Registered: Oct 2005
Location: Bergen, Norway
Distribution: 2005: Libranet 2.8.1 expanded with Debian Sarge 2012: Kanotix 64 bit, antiX 8.5, Crunchbang
Posts: 139

Rep: Reputation: 14
johnMG, do you really think this is a reason to scrap linux?
This is something you just get used to.
i have to use different solutions with different programs, with tvtime gksu works best,
with the libranet xadminmenu sux, but it's not a problem.

Syllable looked interesting but seemed to be about as far from completion as ReactOS..

Is this UNIX at all?
 
Old 03-04-2006, 09:52 AM   #10
deepclutch
Member
 
Registered: Nov 2004
Location: Kerala, India
Distribution: Debian Bookworm
Posts: 773
Blog Entries: 1

Rep: Reputation: 34
Smile

Quote:
Originally Posted by dracae
apt-cache search sux
sux - wrapper around su which will transfer your X credentials
How do we use "sux"
 
Old 03-04-2006, 11:43 AM   #11
dracae
Member
 
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423

Rep: Reputation: 30
Just like su
sux<enter>
<root pass><enter>
<X app to run><enter>
 
Old 03-04-2006, 02:34 PM   #12
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
> >
> > maybe we'll have Syllable ( http://www.syllable.org/ ) before long for desktop use instead.
>
> johnMG, do you really think this is a reason to scrap linux?

For server use? Heck no.

For desktop use? Pretty soon, I just don't think GNU/Linux is going to be able to compete with Syllable for desktop use. Syllable is all about ease-of-use and good design. Once users get this in a GPL'd free OS, it's gonna be tough to get them to go back to X11, cups, alsa/oss, multiple GUI toolkits that you can't copy/paste between, and so on.

> Syllable looked interesting but seemed to be about as far from completion as ReactOS..

Those two projects are very different. When building an operating system, you need smart and experienced developers to build it. It's difficult to get real OS hackers to work on an OS like ReactOS which is just copying an OS that most of us in the free software community want nothing to do with.

Contrast that with Syllable, which is getting more and more attractive to hackers due to lack of backward-compatibility cruft, clean design, and the same favorable licensing as Linux.

> Is this UNIX at all?

I think it's mostly POSIX-compatible, so, yes. It uses most of the normal GNU tools you're used to, but has its own kernel (not Linux), and its own GUI front end (not X11). It's got a directory structure like GNU/Linux, and also some simply-named directories for its own stuff as well. It's based on Atheos, and is also a lot like BeOS. All its core parts are all GPL'd.

It's steadily improving and seems to gain more users/contributers with each release, and is currently fairly usable. I think their next task is to really stabilize the API. At that point, I think you'll see more interest from app developers, and then ball will really be rolling.

Last edited by johnMG; 03-04-2006 at 03:08 PM.
 
Old 03-07-2006, 09:32 AM   #13
coyopil
Member
 
Registered: Oct 2005
Location: Bergen, Norway
Distribution: 2005: Libranet 2.8.1 expanded with Debian Sarge 2012: Kanotix 64 bit, antiX 8.5, Crunchbang
Posts: 139

Rep: Reputation: 14
maybe it's already usable for my aging laptop which is only used for writing and internet?
i'll try
 
Old 03-08-2006, 05:38 PM   #14
deepclutch
Member
 
Registered: Nov 2004
Location: Kerala, India
Distribution: Debian Bookworm
Posts: 773
Blog Entries: 1

Rep: Reputation: 34
Smile

I have a problem while loggin in as "su -".i tried export and it gave some errors.but if i simply login as "su",i can run any gui apps..expecting help..
Code:
prakash@sarge:~$ echo $DISPLAY
:0.0
prakash@sarge:~$ su -
Password:
sarge:~# export DISPLAY=:0.0
sarge:~# gedit
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(gedit:9926): Gtk-WARNING **: cannot open display:
 
Old 03-08-2006, 06:25 PM   #15
dracae
Member
 
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423

Rep: Reputation: 30
First of all, this is not something that simply has not been smoothed out. This is a security feature. You could disable auth, disable remote connections to your X server, and only allow one user to log in at a time. Sure this would be easy, but at this point you may as well use windows. I use debian for security and functionality, while others complain about this because it doesn't work the way they expect, because they expect windows, which has neither.

Now that I got that out of the way.

INSTALL SUX!
It is a wrapper script for su, with the specific purpose of forwarding your DISPLAY variable and xauth cookie.
 
  


Reply



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 12 11-27-2018 01: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
Mplayer: [Xlib: connection to ":0.0" refused by server] elluva Slackware 2 12-18-2003 06:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:56 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration