DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800
Rep:
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.
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.
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.
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800
Original Poster
Rep:
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.
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
Distribution: Debian Sid, SourceMage 0.9.5, & To be Continued on a TP
Posts: 800
Original Poster
Rep:
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.
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.
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
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]
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.