xhost +localhost; xhost +$(hostname)

before you "su"



                                                                                       
                   
                      Erwann Thoraval                                                  
                   
                      <erwann.thoraval@        To:       [EMAIL PROTECTED]             
                 
                      atr.jp>                  cc:                                     
                   
                      Sent by:                 Subject:  Re: [XFree86] connection to 
":0.0" refused by    
                      [EMAIL PROTECTED]         server                                 
                   
                      ee86.org                                                         
                   
                                                                                       
                   
                                                                                       
                   
                      05/20/2004 07:23                                                 
                   
                      PM                                                               
                   
                      Please respond to                                                
                   
                      erwann.thoraval                                                  
                   
                                                                                       
                   
                                                                                       
                   





On Friday 21 May 2004 04:10, Chris Bruyere wrote:
> Hi all, this is my first time sending to a mail list
> like this, so please forgive any "bad etiquete" that I
> may have.  I am running gentoo on a duron 1300 with a
> nVidia Geforce video card.  X starts fine and kde runs
> ok too. However, when I switch to su as a user, I
> can't run any X-based apps. Like emacs for example or
> anything else, below is the error msg I get as well as
> my config file.
>
> Also, I notice that X has a nice value of 0. I would
> like to change that -19 but I haven't been able to.
> Any hints?
>
> Thanks a lot
> Chris Bruyere
>
>
> %emacs (as su, while logged in as bruyere, a normal
> user)
> Xlib: connection to ":0.0" refused by server
> Xlib: No protocol specified
>
> 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.
>
[snip config file]

Hello,

Well, I think the error message is rather clear. When you log in a X
session,
by default, only the user which is logged can launch X applications,
because
he is the only user to have the right to connect to the X server.

So when you want to launch an application as root for instance, you have to
do
2 things :

- root : set the DISPLAY variable (as said above) : export DISPLAY=:0
                                                             or setenv
DISPLAY :0

- user who has launched X : tell the X server to accept connections from
"others" : xhost +

Be careful, 'xhost +' disable protection so any computer can access to your
X
server.

I don't knowan other solution, bu it is strange that you have to do 'xhost
+'.
Maybe you can allow connections for certains users on the local machine,
not
only for certains machines (ie, a user-based authentication and not a
machine-based authentication).

And it's strange that root can't conect to the X server by default (it's
the
same on Debian)..

--
Erwann
_______________________________________________
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86



_______________________________________________
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86

Reply via email to