LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-18-2004, 11:25 AM   #1
Rexversusu
Member
 
Registered: Aug 2004
Location: British Columbia
Distribution: Debian Testing
Posts: 47

Rep: Reputation: 15
Unhappy Problem With Snyaptic - A Newbie Needs Your Help!


Just installed Debian yesterday, along with Snyaptic. When I go into the console, log in as root to run synaptic, I get the following error message:

Quote:
Xlib: connection to "0.0" refused by server
Xlib: Client is not authorized to connect to Server
synaptic:could not open display
Could someone PLEASE explain what this means and how I can fix it?
 
Old 08-18-2004, 11:31 AM   #2
misterflibble
Member
 
Registered: Feb 2004
Distribution: Debian UnStaBle
Posts: 123

Rep: Reputation: 15
This simply means that root is not allowed to launch a new window into the regular user's space from the commandline. There are security reasons for this. Synaptic is usually installed in the apps->system menu (or equivalent) in most of the Debian window managers, did you look there? The menu entry will prompt you for the root password, then launch synaptic. If you can't find a menu entry, just run 'gksu synaptic' without logging into root and it will launch the same way.
 
Old 08-18-2004, 11:39 AM   #3
Rexversusu
Member
 
Registered: Aug 2004
Location: British Columbia
Distribution: Debian Testing
Posts: 47

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by misterflibble
This simply means that root is not allowed to launch a new window into the regular user's space from the commandline. There are security reasons for this. Synaptic is usually installed in the apps->system menu (or equivalent) in most of the Debian window managers, did you look there? The menu entry will prompt you for the root password, then launch synaptic. If you can't find a menu entry, just run 'gksu synaptic' without logging into root and it will launch the same way.
Thanks for the quick reply.

No, synaptic doesn't show up in apps>system. I was under the understanding that it was necessary to log in as root, then type synaptic in the terminal.

And when I type gksu synaptic (as user, not root) I get "bash: gksu: command not found"

Thanks!
 
Old 08-18-2004, 11:42 AM   #4
misterflibble
Member
 
Registered: Feb 2004
Distribution: Debian UnStaBle
Posts: 123

Rep: Reputation: 15
That's odd: synaptic is supposed to depend on gksu. Do you have kde installed? Try 'kdesu synaptic'. Same thing, basically.
 
Old 08-18-2004, 11:43 AM   #5
Rexversusu
Member
 
Registered: Aug 2004
Location: British Columbia
Distribution: Debian Testing
Posts: 47

Original Poster
Rep: Reputation: 15
I'm running WindowMaker
 
Old 08-18-2004, 11:47 AM   #6
misterflibble
Member
 
Registered: Feb 2004
Distribution: Debian UnStaBle
Posts: 123

Rep: Reputation: 15
You installed synaptic via apt-get right? Run (as root) 'apt-get install gksu'.
 
Old 08-18-2004, 11:50 AM   #7
Rexversusu
Member
 
Registered: Aug 2004
Location: British Columbia
Distribution: Debian Testing
Posts: 47

Original Poster
Rep: Reputation: 15
Yes, I did install synaptic via apt-get.

I can install gksu that way too, but before I do, would you mind telling me what I'm about to install? I don't mean to sound ungrateful, but I just want to know what it is.

Thanks for all your help so far, I really appreciate it.
 
Old 08-18-2004, 11:59 AM   #8
misterflibble
Member
 
Registered: Feb 2004
Distribution: Debian UnStaBle
Posts: 123

Rep: Reputation: 15
You're right, I should've explained what it does before you install random things. Gksu is a frontend to su. Just as typing in su prompts you for the password and then lets you do things as root at the console, gksu does the same thing for graphical programs, so 'gksu programname' will let you run any X-Window program with full root privileges. It's useful for doing things ike running a file manager as root so you can mess around with protected files (carefully!). Gksu is the version associated with gnome programs (using GTK) and kdesu is for kde programs (using QT libraries) although they will both work with any program and do the exact same thing.
 
Old 08-18-2004, 12:01 PM   #9
Rexversusu
Member
 
Registered: Aug 2004
Location: British Columbia
Distribution: Debian Testing
Posts: 47

Original Poster
Rep: Reputation: 15
I looked up gksu. I got the basic idea of it, so I got it through apt-get (root), went back to user, typed gksu synaptic and got....

"bash: synaptic: command not found"

Sigh....

And, yes, the little window popped up asking me for root's password to run synaptic.
 
Old 08-18-2004, 12:07 PM   #10
misterflibble
Member
 
Registered: Feb 2004
Distribution: Debian UnStaBle
Posts: 123

Rep: Reputation: 15
I'm guessing you didn't actually install synaptic (maybe the synaptic touchpad drivers instead?), which probbaly explains how gksu wasn't installed. Try 'apt-get install synaptic' again.
 
Old 08-18-2004, 12:15 PM   #11
Rexversusu
Member
 
Registered: Aug 2004
Location: British Columbia
Distribution: Debian Testing
Posts: 47

Original Poster
Rep: Reputation: 15
First, thanks for your patience. I really really really appreciate it. Now for the bad news...

From root, did an apt-get install synaptic...

Got the following....

"Reading Package Lists... Done
Building Dependency Tree... Done
Sorry, synaptic is already the newest version.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded."

Which, I'm assuming means what is says - I have the newest version of synaptic.

???????????????????????
 
Old 08-18-2004, 01:43 PM   #12
Rexversusu
Member
 
Registered: Aug 2004
Location: British Columbia
Distribution: Debian Testing
Posts: 47

Original Poster
Rep: Reputation: 15
Anyone?
 
Old 08-18-2004, 02:29 PM   #13
misterflibble
Member
 
Registered: Feb 2004
Distribution: Debian UnStaBle
Posts: 123

Rep: Reputation: 15
Maybe your paths aren't set up correctly. First check to see if the file /usr/sbin/synaptic exists. Then try 'gksu /usr/sbin/synaptic'.
 
Old 08-18-2004, 03:04 PM   #14
Rexversusu
Member
 
Registered: Aug 2004
Location: British Columbia
Distribution: Debian Testing
Posts: 47

Original Poster
Rep: Reputation: 15
Looking at the firefox thread in this software forum, it looks like a similar problem. He pointed to this article (I think)...

Quote:
Hi,
>
> sometimes I need to run some X apps as root (i.e. ethereal, lprngtool) but
> Xlib complains that the server refuses the connection.
> how can I make the Xserver accept programs as root when I'm working as
> normal user?
>

Script started on Tue Jul 3 16:54:48 2001
[16:54:49 tmp]$ zgrep -A71 'How do I run an X client as root when the X session is run by a user?' /usr/share/doc/xfree86-common/FAQ.gz | tail -73
--
*) How do I run an X client as root when the X session is run by a user?

If a normal user is running an X session (from startx or xdm), and that
user, for instance, uses the su command from within an xterm to become root
and then runs a program that tries to do something with the X server, the
following error messages (or something similar) are usually seen:

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

This happens because of an X security mechanism, which uses "magic cookies"
stored in a file in the user's home directory (readable only by the user)
called .Xauthority. If the environment variable XAUTHORITY is not set (see
below), X clients attempt to authenticate themselves by using the
.Xauthority file found in the directory specified by the HOME environment
variable. Of course, if user "branden" is running the X session, and he
then uses su to become root, $HOME will be "/root" instead of
"/home/branden", and the correct .Xauthority file will not be found (even
if there is an .Xauthority file in /root, it will not contain the correct
magic cookies unless the root user has deliberately made it that way).

There are therefore a number of ways to solve this problem.

If only one user ever becomes root, and if root never starts an X session,
there is a one-step, permanent solution (provided you don't rearrange your
filesystem).

Become root, then:
cd
ln -s /home/branden/.Xauthority .Xauthority

Of course, you will want to replace "branden" in the above example with the
name of whatever user has access to the root account.

Alternatively, and more appropriate for more complex situations than the
one described above, you may simply issue commands while root that will tell
the X clients where to look for the .Xauthority file. If you set the
XAUTHORITY environment variable to the path to the appropriate user
.Xauthority file. If the su command is used, all of the environment of the
invoking user is inherited except for $PATH; therefore, each user who has
access to the root account could set the XAUTHORITY variable in their shell
startup files, and this variable will be passed to the root shell.

Other alternatives include modifying the root shell startup files to sense
the invoking user and setting XAUTHORITY, making command aliases that set
that variable for the invocation of specific commands, or configuring the
super or sudo programs with appropriate rules.

The most straightforward method (but not the one that requires the least
typing), is simply to set XAUTHORITY with each command you issue as root
that needs to access the X server.

For Bourne-type shells (sh, bash, ksh, zsh):
XAUTHORITY=/home/branden/.Xauthority xeyes

For C-shell-type shells (csh, tcsh):
( setenv XAUTHORITY /home/branden/.Xauthority; xeyes )

Users of ssh's X11 forwarding feature should note that ssh sets the DISPLAY
and XAUTHORITY variables itself, and does not use $HOME/.Xauthority for the
latter. If you frequently employ this feature of ssh you should not
unconditionally set XAUTHORITY in your shell's startup files. (You
shouldn't do that with DISPLAY, either, but most people know better than to
try. )

Finally, you should NEVER, EVER use the xhost command to manage X server
access control unless you know exactly what you are doing (even then,
there's hardly ever a good reason short of seeing just how many ways the
security of your system can be compromised). Use the xauth command
instead; the EXAMPLES section of its manual page is instructive for the
most common tasks.

[16:55:02 tmp]$ exit
exit

Script done on Tue Jul 3 16:55:04 2001

--

Shaul Karl <shaulka@bezeqint.net>

Hillel used to say: If I am not for myself who will be for me?
Yet, if I am for myself only, what am I? And if not now, when?
(Ethics Of The Fathers 1:14)
It seems like that is probably my problem. Unfortunately, I don't, for the life of me, understand how to follow the instructions to fix it.
 
Old 08-18-2004, 03:20 PM   #15
misterflibble
Member
 
Registered: Feb 2004
Distribution: Debian UnStaBle
Posts: 123

Rep: Reputation: 15
This is a needlessly complicated solution to your problem since gksu and kdesu take care of it just fine. Seriously, try gksu to run a file manager or something and you'll see that you can run it as root. The problem now seems to be we can't find synaptic.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie Problem aMsn svenhook Linux - Software 8 06-24-2005 07:29 AM
A little newbie problem little_ball Red Hat 1 11-27-2004 12:52 PM
Newbie LILO problem goggyturk Linux - Software 7 10-15-2003 06:03 PM
extreme newbie problem...Portsentry Problem ImAnEwBiE Linux - Newbie 1 08-26-2003 09:18 AM
newbie problem dartania Linux - General 7 08-17-2003 04:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration