Mailinglist Archive: opensuse (4631 mails)

< Previous Next >
Re: [opensuse] Getting error "cannot connect to X server" when using sudo to run a program
  • From: Joseph Loo <jloo@xxxxxxx>
  • Date: Thu, 18 Jan 2007 20:09:55 -0800
  • Message-id: <45B04493.7010503@xxxxxxx>
Patrick Shanahan wrote:
> * Andy Harrison <aharrison@xxxxxxxxx> [01-18-07 16:23]:
>
>> On 1/18/07, Graham Smith <gqs@xxxxxxxxxxxxx> wrote:
>>
>>> I get "cannot connect to X server" error when I try to run the
>>> program on my laptop. If I use kdesu I have no problem but I don't
>>> want to use it as it means I have to enter the root password each
>>> time I run the command.
>>>
>> Make sure that root is allowed to use your X server. From a regular
>> shell prompt:
>>
>> xhost +SI:localuser:root
>>
>
> If kdesu will get there, root IS allowed....
>
>
Do not forget to set your DISPLAY variable. That will allow you to
connect to the X11 server.

By the way, if you need to run an X11 window, I suggest you use ssh -X
root@localhost instead. It sets everything up properly for you.

--

Joseph Loo
jloo@xxxxxxx

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >