[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

Xlib: connection refused

I boot may X as a user.
When I need root permition I su  to root.
for some resone I cant run any X application as root (DISPLAY env is fine :0 )
The message I get is:

Xlib: connection to ":0.0" refused by server
Xlib: Client is not authorized to connect to Server

Only if as a user i do xhost + (to disable authentications) can i run X based programs as root

Where should I lok for an answer ?
P.S (almost all may packages are updates of RH 6.1 or mandrake)
0
finkelg
Asked:
finkelg
  • 2
  • 2
1 Solution
 
ahoffmannCommented:
you gave the answer yourself: xhost +

check X and/or xhost man-pages for details, you also may use X's -auth option, but it's more complicated to setup
0
 
finkelgAuthor Commented:
When using xhost + evry one from that host can run x clients on my server.

The better answer I found was that I have an .Xauthorty file in my home dir which uses a MAGIC-KEY ... with a code for each display I want to protect (Usally :0 ).
If I whant others(root too) to connect to that display they too need the .Xauthorty file with    that code so here what you do:

Run xauth list, copy the code, su to the user you what to give excess, xauth add . <the code you copy> ,

Now that user can X client to my X server but others cant
See also Xauth menuals
0
 
ahoffmannCommented:
so, what's the question now?
0
 
finkelgAuthor Commented:
None just wanted you to know
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now