[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Xlib: connection to ":0.0" refused by server ???



> daves debian wrote:
> > When i am logged in as a user, I want to execute an X program as
> > root, I type
> > su
> > <password>
>
> ...
>
> > The X library has been refused by the X server, because root is not
> > autherised to connect to the server ??
>
> ...
>
>    only authorized user can connect to X server, just because you are
> root doesn't mean you can connect to X server on given machine (just
> like you cannot connect to other services - e.g. you'd still need
> password for database, ...)
>
>    you have few options:
>
>    1) xhost (see man xhost), don't do that though!
>
>    2) as root run: xauth merge ~userThatRunsX/.Xauthority
>
>    option 2 will give you access to X server without compromising
> security (while it's running, if you restart X you have to run xauth again)
>
> 	erik

alternatively you can do this in the root home directory (/root):

ln -s ~userThatRunsX/.Xauthority .

This will work as long as you don't log in in X as root. Then, the .Xauthority 
file will be overwritten.

Tobias

-- 
/"\ ASCII Ribbon Campaign
\ / No proprietary formats in attachments without request
 X  i.e. *NO* WORD, POWERPOINT or EXCEL documents
/ \ Respect Open Standards

Registered Linux User #293344



Reply to: