D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Using Synaptic

 

On Fri, Sep 16, 2005 at 01:39:09PM +0100, Mark wrote:
> On Friday 16 Sep 2005 09:35, Ray Smith wrote:
> > I have installed knoppix debian  to harddisk and updated. downloaded
> > synaptic.When I try to run I am told to use as root but cant connect to the
> > display 0:0 . Other programs Í installed using apt run ok. Any help please
> > ?
> >
> > Ray.
> > Sent wirelessly using P910i.
> >
> >
> > --
> > The Mailing List for the Devon & Cornwall LUG
> > Mail majordomo@xxxxxxxxxxxxx with "unsubscribe list" in the
> > message body to unsubscribe. FAQ: www.dcglug.org.uk/linux_adm/list-faq.html
> 
> As a temporary measure, as a user, type 
> 
> xhost +
>  in a command line - and press enter.
> 
> This is not the most secure thing in the world, so once you have finished,type 
> 
> xhost - 
> 
> and press enter :)
> 
> Alterantively, if using KDE, you could try 
> 
> kdesu -c synaptic
> 
> which should bring up a dialog box where you type in your password - then you 
> can run synaptic
> Mark
> 
> --
> The Mailing List for the Devon & Cornwall LUG
> Mail majordomo@xxxxxxxxxxxxx with "unsubscribe list" in the
> message body to unsubscribe. FAQ: www.dcglug.org.uk/linux_adm/list-faq.html

If you want a more secure solution you need to explicitly allow the su'd root shell 
to use the display.

Before you su to root, type 'xauth list' then press [enter]
You should see an item something like this:
localhost.localdomain:0  MIT-MAGIC-COOKIE-1 05fc202994288c9eb22702a73bd28a5e
Copy the whole line.

Now, su to root.
Type xauth list then [enter]. You probably won't get any output.
Now, type 'xauth add ', then paste the line you just copied, then
press [enter].

That's added the magic cookie for your local X display. Now root has the
magic cookie, all X applications started from that shell will run as normal.

Try xeyes to test it out.

Unfortunately, the cost of this more secure solution is that you must do
it *every* time you su to root.

I used to get this problem on my old RedHat box, when using aterm or
rxvt. I have no idea why, but now I use Debian and xterm it keeps the
magic cookies when I su to root. If you're not using xterm I suggest you
try that first to see if it automagically keeps the cookie.

Cheers,
John

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe. FAQ: www.dcglug.org.uk/linux_adm/list-faq.html