On Sun, 2 Sep 2001, Paul O'Neil wrote:
> Small problem but how do i fix it? When I execute a program as root I get
> the following
> Xlib: connection to ":0.0" refused by server
> Xlib: Client is not authorized to connect to Server
> Error: Can't open display: :0.0
> if I execute as non-root I get permission denied. I know it has
> something to do with suid stuff but I'm confused how all that works.
It's actually not to do with suid stuff, more to do with who is authorised
to run programs on your X session. Somebody else can explain the exact
technical reasons why, but try entering the command "xhost localhost", in
an X terminal (a shell running in X) as the user who started the X
session. Not as root or any other users!
I haven't read up much on xhost, but basically it lets you choose what
hosts/machines are allowed to utilise your X server. Dunno how or why it
won't let other users on the local machine connect (eg. root), but the
above command will let any user on localhost (ie. the local machine) run a
program on your X session.
Trevor
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!