LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-18-2003, 03:58 PM   #1
BittaBrotha
Member
 
Registered: Jan 2002
Location: Third Stone from the Sun
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800

Rep: Reputation: 31
Root Command Problems


It seem that when I try to run programs from the command line as Root, I always get this error messages:

xcdroast
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Gtk-WARNING **: cannot open display: :0.0

Then it drops back to the commandline....but I can run commands as normal users. I believe it has something to do with debconf or something like it. Also, I get these type of error messages when I do apt-get install programs, but the programs seem to install and run fine as normal user.

I'm using Debian Sid with kernel 2.4.21 and Gnome desktop 2.2.

Ok, this is what I get when I do apt-get install program:

Gdk-WARNING **: locale not supported by C library
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Gtk-WARNING **: cannot open display: :0.0
debconf: unable to initialize frontend: Gnome
debconf: (DISPLAY problem?)
debconf: falling back to frontend: Dialog

Thnx.

Last edited by BittaBrotha; 07-18-2003 at 04:28 PM.
 
Old 07-18-2003, 06:19 PM   #2
gabriele_101
Member
 
Registered: Oct 2001
Location: CAMBRIDGE, MA USA
Distribution: RH9 Kernel 2.4.20-18.9
Posts: 69

Rep: Reputation: 15
Sounds like you logged in as some user (foor) and su'ed to root form a terminal.

Open another terminal, and type:

xhost +localhost

And when you're done type:

xhost -localhost

SHould work. Root does not automatically have privileges to launch windows on your X-server just beacause it's root. The address from which root is trying to connect must be allowed to connect to the X-server.

Also, you will only get this error if you are trying to launch a GUI driven application/utility. Some of them will work in text-only mode, so you might find that easier. Many will also work as user "foo" and just prompt you for root password if they need privileges.

-G
 
Old 07-18-2003, 09:39 PM   #3
BittaBrotha
Member
 
Registered: Jan 2002
Location: Third Stone from the Sun
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800

Original Poster
Rep: Reputation: 31
When I type xhost +localhost, this is what I get:

xhost +localhost
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

and then back to command prompt and I'm doing this as root.

Well since this post, I tried it as normal user and it works. Now should root be able to run a normal program command from the CLI?

I'm trying to use xcdroast to burn cds and when I started it as normal user, I got message saying it needs to be ran as root first.

Is there another way to run it as root?

Thnx.

Last edited by BittaBrotha; 07-18-2003 at 09:42 PM.
 
Old 07-18-2003, 11:34 PM   #4
gabriele_101
Member
 
Registered: Oct 2001
Location: CAMBRIDGE, MA USA
Distribution: RH9 Kernel 2.4.20-18.9
Posts: 69

Rep: Reputation: 15
Yes, as root you'd get that message. Only the user that started the X-session (the username you used to log into the graphics login for linux) can authorize others to connect, that's why I has suggested starting another terminal to manage xhost. Their are good reasons for that and you don't want it any other way.

As for the xcdroat issue:

http://www.xcdroast.org/xcdr098/README.nonroot.txt

Just update the to latest alpha, since they're all alpha anyway

Donno if this helps, but hey, I tried!

-G
 
Old 07-20-2003, 11:17 AM   #5
BittaBrotha
Member
 
Registered: Jan 2002
Location: Third Stone from the Sun
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800

Original Poster
Rep: Reputation: 31
I'm still having the same problem running some programs as root. I think it has something to do with the choice of which program to use for configuration screens, Debconf, or the default one, I forget the name of it.
 
Old 07-30-2003, 03:50 AM   #6
doggizback
LQ Newbie
 
Registered: Jul 2003
Distribution: Red Hat 9.0
Posts: 5

Rep: Reputation: 0
i always log into x as root, which yeah, i know, is frowned upon...but its gonna be hard convincin me not to. is there any way to force say, gtk-gnutella or something ruther to run as root? i got what i thought was the hard part done..installed java cause i was gonna use lamewire. now i have gtk-gnutella installed, but it keeps tellin me never run as root, and when i do a su from the command line (logged into X as root) and go to my normal user, it gives me the same errors it gave him. and since he edited his post, i dont know what he did to fix the problem. basically, how can i force this to run as root, and..yeah...HELP
 
Old 07-30-2003, 04:02 AM   #7
BittaBrotha
Member
 
Registered: Jan 2002
Location: Third Stone from the Sun
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800

Original Poster
Rep: Reputation: 31
You probably can't run it as root, since it may think gtk-gnutella will open up ports. Maybe for security reasons!

My problem was in the case of xcdroast, it had to run as root for the very first time and It's having problems running as root because of my installation of Debian, I believe.
 
Old 07-31-2003, 12:20 AM   #8
gabriele_101
Member
 
Registered: Oct 2001
Location: CAMBRIDGE, MA USA
Distribution: RH9 Kernel 2.4.20-18.9
Posts: 69

Rep: Reputation: 15
doggizback:

You'll have to use xhost too. If you put this:
Code:
xhost +localhost
sudo /path/to/gtk-gnutella
xhost -localhost
in a script and run it as a non-root user, you should be OK. I don't recommend setting xhost +localhost permanently since it is a security risk, albeit minor if you have only trusted users on a secure machine.

As for running gnutella based apps as root, it's a really bad idea. Any gnutella app running as root could and often would compromise the security of your system.

BrittaBrotha:

Which version of xcdroast are u using? Version 0.98alpha14 can run in non-root mode and comes with instructions on how to do that.

-G

Last edited by gabriele_101; 07-31-2003 at 04:51 PM.
 
Old 07-31-2003, 09:16 AM   #9
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
The real solution here is to solve the permissions problems that require you to run a program as root (i.e., put your normal user in a group that has the correct permissions) or if it must be run as root, to use something like sudo to circumvent these problems. That's what those sorts of tools were designed for. I recommend sudo highly anyway and suggest that you never su to root again
 
Old 07-31-2003, 10:03 AM   #10
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
Lightbulb

BittaBrotha,

I think the distinction to make here is to:[list=1][*]log into your GUI desktop as you[*]run 'xhost +localhost' as you (but replace localhost with whatever your hostname is (run 'hostname' to see) -- possibly "localhost")[*]run xcdroast as root. If using sudo, 'sudo xcdroast', otherwise, 'su root' then 'xcdroast'[*]When done, if you used su stop being root by typing 'exit'. Then, as you, run 'xhost -localhost' (replacing localhost with your hostname)[/list=1]
 
Old 07-31-2003, 09:41 PM   #11
BittaBrotha
Member
 
Registered: Jan 2002
Location: Third Stone from the Sun
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800

Original Poster
Rep: Reputation: 31
Why do I get all these kind of messages even when I do an apt-get and the program still works okay as root or normal user?

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

and

this is what I get when I do apt-get install program:

Gdk-WARNING **: locale not supported by C library
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Gtk-WARNING **: cannot open display: :0.0
debconf: unable to initialize frontend: Gnome
debconf: (DISPLAY problem?)
debconf: falling back to frontend: Dialog

Thnx.
 
Old 07-31-2003, 10:21 PM   #12
Strike
Member
 
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
Ah, if you are going to su to root to use apt-get, then you'll want to not use the Gnome frontend to debconf. If you use sudo, it should work fine.

To change your debconf frontend do:

Code:
dpkg-reconfigure --frontend=dialog debconf
Assuming you have dialog installed. Dialog is the frontend I use, personally.
 
  


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
Is there some command to clone root a/c DriveMeCrazy AIX 1 09-05-2005 06:09 AM
Doing command as root Ephracis Linux - Software 2 10-27-2004 04:30 AM
rm command even as root ch4s3r Linux - Software 4 11-07-2003 12:45 PM
root command zokter Linux - Newbie 4 06-14-2003 05:26 PM
Help...Can only log in as root after this command ScreeminChikin Linux - General 5 11-12-2002 08:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:56 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