• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

ROOT gui restrictions with Debian

Netopia

Diamond Member
Hey Guys,

I'm on a Debian Etch box, and although I've got KDE and gnome installed and both seem to work fine, if I try to launch programs from the CLI, I get errors and cannot. Examples are posted below.

Any ideas are much appreciated,

Joe

 
Something is goofy with your display variable.

Try:
echo $DISPLAY

from your x terminmal.

It should normally reply:
:0.0

If not then you may have some scripts or something like that that is setting a display variable. Try openning up just 'xterm' and see if you get the same results.
 
When I simply type "xterm" I get:

myroot@mailscan:~$ xterm
Warning: Cannot convert string "nil2" to type FontStruct

But the xterm(inal) window opens and operates just fine.

When I issued the echo $DISPLAY I got:

mailscan:/home/myroot# echo $DISPLAY
unix:1022.0

Which is a far cry from what you said would be expected.

Hmmm..... still lost...
 
I don't know if it makes a difference, but I should point out that I am remote via FreeNX. I just tried connecting via FreeNX to another box, and could launch programs from the CLI without problem. When I issued "echo $DISPLAY" on that machine, I got "unix:1000.0, so that doesn't seem very different.

Another thing that could be a problem is that this machine is currently set to run at runlevel 3, but since it's a Debian machine, runlevels don't normally make much difference between 2 and 5 (IIRC). I wanted the machine to boot to a text screen and no gui by default, so I googled around a bit and found that if I were to go into /etc/rc3.d and remove the entries for gdm and kdm (S21gdm and S99kdm) that I would be able to boot to a terminal screen and start a gui session at will via startx. I did as directed and all worked well.

I'll reboot into one of the other run levels that still has gdm and kdm running and let you know if that was the root of the problem or if there is still something else that is the cause.

Joe
 
Ok... I found the problem and it's much different than what I had thought.

When I'm setting a machine up (as I am this one) I prefer to log in as root and do all the things I need to do, and get out. Debian doesn't let root even log into the gui LOCALLY by default. I did discover that after I had changed things to not start the gui automatically, that I could log into the console as root and then issue a startx and I could get a desktop AS ROOT locally.

After I installed FreeNX, I expected to be able to log in as root remotely, after a warning for logging in as root, as I can with my FCx boxen. Unfortunatly, NX simply said that root was not allowed to be an NX user. POOP! Oh well... I figured that I would have to end up logging in as a regular user, and then su'ing to root in a terminal and launching whatever apps I wanted to use as root from there.

That, it turns out, was the problem. I just discovered that as the regular user, I can launch whatever I want... but if I "su root" in the terminal window, I can no longer launch GUI apps! Darn! They just don't want you to do ANYTHING as root with a GUI I guess! I don't know why they (Debian) are so against root being able to use a GUI.

Anyone have any ideas on how to:

A) work around not being able to log in via NX as root

or

B) work around root not being able to launch GUI apps?

I generally like Debian thus far, but this shackling of root's hands behind his back is more than a bit irritating!

Joe
 
FreeNX is definately a different beast then regular X Windows.

It does all sorts of bizzare things to make X run faster. It does things like have it's own special shell and user and own passwords and such that seperate from normal Linux user stuff. I don't know much about it because it's kinda odd to work with. Nowadays I use Linux on everything so I just use X over ssh when I want to remote to something. It's fast enough that I use it over the internet and such and plain X works fine for me as long as there is no animations.


If you want root rights without using su you can use sudo.

Ubuntu has sudo setup by default, but with Debian you have to install it.
apt-get install sudo

then you have to run visudo (since editing the sudo config file directly is generally considured a bad idea in multiuser environments)
visudo

Then add your user you want to use as a administrator to that. You add a line like:
netopia ALL=(ALL) ALL

Then after you do that then you can run any command you want with root rights, including GUI applications. If you don't want to use a password period you can go like:
netopia ALL=(ALL) NOPASSWD: ALL

The only gotcha is that if you open up a new program with root rights it may make some of your preference files (~/.??*) with root permissions instead of your user's permissions. This can cause problems later if you to use those programs later as your regular use. A
chown -R netopia:netopia /home/netopia
is a easy fix.

Also obviously sudo is a security risk so use it wisely. You may want to setup a special admin user just for using sudo. Give it a red background so that you don't forget which user your using. Something like that.

For GUI apps that are smart enough to ask for su or sudo passwords you can setup libgksu and/or use gksudo or gksu commands.
Check out /usr/share/doc/libgksu2-0/README.Debian for details.
 
There generally aren't any GUIs you should have to run as root...

I've had trouble running GUI applications as a different user than the user I'm logged in as before. A good xhost should clear that right up.

Try: xhost +local:root Then running an xterm.

Because FreeNX isn't an environment I can test at the moment, your settings may be a bit different than what I gave you (which works for non-root users).
 
There generally aren't any GUIs you should have to run as root...

I've had trouble running GUI applications as a different user than the user I'm logged in as before. A good xhost should clear that right up.

Try: xhost +local:root Then running an xterm.

Because FreeNX isn't an environment I can test at the moment, your settings may be a bit different than what I gave you (which works for non-root users).
 
drag,

I went through the whole sudo setup and gave the user the "nopasswd" setting too, but it just DOESN'T LIKE people running GUI apps with root priv's!

mailscan:/home/myroot# sudo konqueror
Xlib: connection to "unix:1029.0" refused by server
Xlib: No protocol specified

konqueror: cannot connect to X server unix:1029.0


Weird, eh?

Joe
 
n0c,

Where am I running the command "xhost +local:root"? I tried it from a terminal in a desktop, and that didn't work, basically gave me the same sort of error as for any of the gui programs. If what I just said was stupid, please pardon my padawan skills... I'm still learning!

Joe
 
Originally posted by: n0cmonkey
There generally aren't any GUIs you should have to run as root...

Ubuntu has a whole ton of admin tools that run as 'root'. I have a grub editor gui that needs to run as root, Sometimes I like to launch a konsole as root, or a file manager as root, or kate as root, etc.

There are not that many, but they make my life a lot easier.
 
Originally posted by: Netopia
n0c,

Where am I running the command "xhost +local:root"? I tried it from a terminal in a desktop, and that didn't work, basically gave me the same sort of error as for any of the gui programs. If what I just said was stupid, please pardon my padawan skills... I'm still learning!

Joe

Here's how I tested that:
  1. logged into ubuntu, fired up a terminal
  2. su'ed to root (actually sudo su - 😛)
  3. ran xterm, got similar error to yours
  4. ran xhost +local:root in the same terminal window
  5. ran xterm again, and it succeeded

I haven't had to mess with xhost enough to know whether those are session or system based changes.

Of course, the FreeNX application may make this more difficult. The local part of my command means just that. You might want to try something like (and consult the FreeNX documentation on this): xhost +HOST_IP_ADDRESS:root where HOST_IP_ADDRESS is the ip of the remote machine.
 
Originally posted by: sourceninja
Originally posted by: n0cmonkey
There generally aren't any GUIs you should have to run as root...

Ubuntu has a whole ton of admin tools that run as 'root'. I have a grub editor gui that needs to run as root, Sometimes I like to launch a konsole as root, or a file manager as root, or kate as root, etc.

There are not that many, but they make my life a lot easier.

Generally != Ubuntu
 
No, but all those nice admin tools can run and be installed in many other linux distros.

There are a lot of people out there working to have full gui control over their computers.
 
Originally posted by: sourceninja
No, but all those nice admin tools can run and be installed in many other linux distros.

There are a lot of people out there working to have full gui control over their computers.

Generally doesn't necessarily mean linux either. 😉
 
The GUI is overrated.

Personally I _never_ use a graphical file manager or anything else outside my home directory. I don't have a need to.

The fact that Ubuntu relies on sudo/gksudo for everything is a bad sign. The only real reason you should use it is when your installing/uninstalling software.


For this FreeNX problem. It's definately a problem, I guess I have avoided it in the past because of accident.

The odd thing is that freenx has it's own shell and it's own 'nx' user account and such for running. I bet they have some FAQ about it...
 
Originally posted by: n0cmonkey
Originally posted by: sourceninja
No, but all those nice admin tools can run and be installed in many other linux distros.

There are a lot of people out there working to have full gui control over their computers.

Generally doesn't necessarily mean linux either. 😉

I think it does in a linux thread.

I guess my answer then is generally there are no root accounts, you should already be running as admin. 🙂
 
Originally posted by: sourceninja
Originally posted by: n0cmonkey
Originally posted by: sourceninja
No, but all those nice admin tools can run and be installed in many other linux distros.

There are a lot of people out there working to have full gui control over their computers.

Generally doesn't necessarily mean linux either. 😉

I think it does in a linux thread.

I guess my answer then is generally there are no root accounts, you should already be running as admin. 🙂

Generally the admin should have setup the machine so you don't even need to know there is an admin account. 😉



Anyhow, I've contributed enough junk to the thread. 🙂
 
I just connected from a CentOS box using the proprietory Nomachine NX client to my Debian box running FreeNX and had no problem launching applications with 'sudo'.

So I don't know what is going on.
This is what I ran.
sudo nautilus --no-desktop


What versions of what software are you running?
Were did you get your NX server stuff from?

I used the packages from sidux nx repository as I found on this page:
http://wiki.debian.org/freenx

 
When I'm setting a machine up (as I am this one) I prefer to log in as root and do all the things I need to do, and get out. Debian doesn't let root even log into the gui LOCALLY by default. I did discover that after I had changed things to not start the gui automatically, that I could log into the console as root and then issue a startx and I could get a desktop AS ROOT locally.

You should get out of that habit. On a normal installation it's enough to login normally, run 'su -' to get a root shell, 'export DISPLAY=:0' to set the display to local, run 'xauth merge /home/username/.Xauthority' and then you should be able to launch any X apps as root. Sure it's a few extra steps but it's better.

But I have no idea how the NX stuff is interacting with things and breaking them since I've never use it.
 
Back
Top