You are not logged in.
I don't want to whine, but I'm just really confused right now.
All of a sudden, i can't run X applications as root user, I get a "cannot connect to display" (or something like that) message. Copying my /home/user/.Xauthority to /root does the trick but lasts only until I logout. But what i want to know is this : How come I didn't have to do this just 30 minutes earlier ? Obviously an install or upgrade did this, so help me out please.
Also, in an openbox session, my gtk-icon-theme isn't used by any file manager.
So what is the problem ? Thanks in advance...
Last edited by moljac024 (2008-02-02 15:08:27)
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
it's not really recommended to run X applications as root.
have you tried gksu[do] or kdesu[do]?
Also, in an openbox session, my gtk-icon-theme isn't used by any file manager.
in my ~/.gtkrc.mine i have smth like:
gtk-icon-theme-name = "Tango"
which file manager do you use?
vlad
Offline
It is the correct behaviour. Su and sudo are the way to go. There is a well know workaround with which root is allowed to contact the X server, but I will not mention it because it is a security risk
Mortuus in anima, curam gero cutis
Offline
it's not really recommended to run X applications as root.
have you tried gksu[do] or kdesu[do]?Also, in an openbox session, my gtk-icon-theme isn't used by any file manager.
in my ~/.gtkrc.mine i have smth like:
gtk-icon-theme-name = "Tango"
which file manager do you use?
vlad
My .gtkrc-2.0 and .gtkrc.mine have the exact same line. But I figured it out for openbox, it was using the default startup script which took settings from GNOME (which seem to be placed somewhere else). When I logged into GNOME and told it to use tango, it worked for openbox.
As for running X applications as root, I sometimes want to copy files to a system folder with a file manager or use geany to edit a system file. Is that so bad ? :-)
But the point is that i had no trouble with that earlier this day. Must be some package that I installed during this day that changed something. I just want to get to the bottom of it.
It is the correct behaviour. Su and sudo are the way to go. There is a well know workaround with which root is allowed to contact the X server, but I will not mention it because it is a security risk
Well that's the way I want to do it. I open up a terminal, type 'su', type my root password, and want to open geany to edit a file as root. I never log in as root, what do you take me for ? :-)
Last edited by moljac024 (2008-02-02 16:21:05)
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Have you updated your nvidia driver recently? (If you have a nvidia card that ís)
Offline
I know that there are xinitscripts around which fiddle with xhost (the tool of the above workaround ).
There is nothing wrong in what you want to do, but sudo and derivatives allow you to do that safely.
Last edited by patroclo7 (2008-02-02 16:26:44)
Mortuus in anima, curam gero cutis
Offline
Doesn't sudo give you root permissions but ask for your own user password ? That makes no sense to me and I will not use that. Never. I had enough of sudo while i was using ubuntu....
Also, with sudo you have to type the password for each command you want to run with root privilege, which is very tedious.... I want to use su. But if sudo could be configured to ask for the root password instead of the user password I will consider using it.
Last edited by moljac024 (2008-02-02 16:47:28)
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Doesn't sudo give you root permissions but ask for your own user password ? That makes no sense to me and I will not use that. Never. I had enough of sudo while i was using ubuntu....
Also, with sudo you have to type the password for each command you want to run with root privilege, which is very tedious.... I want to use su. But if sudo could be configured to ask for the root password instead of the user password I will consider using it.
sudo does not ask for a root password for each command you want to type, it should remember it for a few minutes for the exact reason you mentioned. You can also use sudo -s to get a root shell.
As for asking the user password instead of the root password, it gives the sysadmin the freedom not to hand out the root password, and ensures that the user is really the user (somebody can't just walk up to a logged in computer and use sudo)
% cat signature
cat: signature: Permission denied
Offline
It does make sense because the system administrator defines in sudoers which actions a certain user and group is allowed to do as root (it does not give you GENERAL root permissions).
Mortuus in anima, curam gero cutis
Offline
Ok, it does make sense in some cases, just not mine. I'm the only admin here in my home :-)
I'm still used to using 'su'. What could be changing my /root/.Xauthority every time I log in ?
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
You can also set up sudo to do all operations, if you wish. But the point is different. Using sudo you can actually disable the root account, which is very good when you are the only user on the machine. It is good because the user "root" is universal, so, if somebody was trying to break in your machine s/he would only need to find out the password. Instead, with sudo and disabled root account, they need to know both the username and the password. I think it is very convenient. I have even disabled the password, so I can run sudo without typing the password every time. Once the potential abuser knows my password, there is nothing to stop him/her from running sudo, so why bother with tedious typing? This of course allows you to complicate the password even further, since you will have to type it less times. This equals to me to improved security, if there is a *safe* password, that is.
Another good thing to do for me is allowing only local users to use sudo, so even if people actually manage to break in via ssh, they wouldn't be able to get root privileges
That is all to say: use sudo!
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
He does not like sudo!!! I think everybody has to respect that. I prefer sudo too. If he asks for a solution without sudo there is really no reason to keep telling how great sudo is (and yes it is really great IMHO). The nice thing about Linux is that everybody is free to do what he likes to. As I remember you can put following into your .bashrc
xhost +
WARNING:
As mentioned before that is bad practice and can harm your system!!!
Offline
Yes, 'xhost +' allows any user to contact the xserver. I did never understand why 'xhost +root' does not work (if you look at the man page of xhost, it SHOULD work), but it doesn't work.
Mortuus in anima, curam gero cutis
Offline
First of all, thanks for the replies everyone!
sudo does not ask for a root password for each command you want to type, it should remember it for a few minutes for the exact reason you mentioned. You can also use sudo -s to get a root shell.
As for asking the user password instead of the root password, it gives the sysadmin the freedom not to hand out the root password, and ensures that the user is really the user (somebody can't just walk up to a logged in computer and use sudo)
Isn't that remembering for a few minutes a security risk ? I don't know, that's why I ask
You can also set up sudo to do all operations, if you wish. But the point is different. Using sudo you can actually disable the root account, which is very good when you are the only user on the machine. It is good because the user "root" is universal, so, if somebody was trying to break in your machine s/he would only need to find out the password. Instead, with sudo and disabled root account, they need to know both the username and the password. I think it is very convenient. I have even disabled the password, so I can run sudo without typing the password every time. Once the potential abuser knows my password, there is nothing to stop him/her from running sudo, so why bother with tedious typing?
Hmm, if someone breaks into your machine can't he/she list your /home directory ? Wouldn't finding out the username be easy like this ?
Please explain to me how disabling typing the password for sudo is good and safe practice and I will start using it immediately
If you guys think so much of sudo, I might want to re-think it's usability then.
Also thanks for the tip May-C, but if it is bad practice I won't be doing it. Still don't know why arch doesn't default to this behavior then since it wasn't stopping root from running X or any X apps earlier...
EDIT: I know this is off-topic but one thing i never understood was /sbin/shutdown. Why does linux require root privileges for shutting down and restarting a machine the safe way ? It only encourages people to hit the power button....
Last edited by moljac024 (2008-02-02 18:48:12)
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Isn't that remembering for a few minutes a security risk ? I don't know, that's why I ask smile
Can anybody access your computer? If they can't then I don't even see a problem with running it as root. (besides the ability to accidentally remove the whole filesystem)
EDIT: I know this is off-topic but one thing i never understood was /sbin/shutdown. Why does linux require root privileges for shutting down and restarting a machine the safe way ? It only encourages people to hit the power button....
This whole discussion about sudo is off topic.
Anyway, think about a large shell server. If you could shutdown as a user, anybody with an account could shut this server down.
% cat signature
cat: signature: Permission denied
Offline
But anyone can hit the power button which is way worse , isn't it ?
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Ok, it does make sense in some cases, just not mine. I'm the only admin here in my home
You don't understand sudo then. You can have it set up anyway you want, having to type the password every time or every few minutes of non use is the default behavior. You can set it to NO password or you can set it to NO password for just specific task while other important task are still protected by sudo.
You are thinking one dimensional, either u have it or you don't.
Offline
But anyone can hit the power button which is way worse , isn't it ?
If your that serious about your security, then you set a bios password and lock the case to prevent cmos wipe.
Offline
Ok, back to topic: what's overwriting my /root/.Xauthority file everytime I log in ?
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
I guess that the Xauthority is good for only one X session: it's not overwritten, it is valid for nly one X sesssion
Mortuus in anima, curam gero cutis
Offline
Well, I *was* able to 'su' and run geany or thunar or whatever... i just don't understand what has changed and is forcing me to overwrite root's .Xauthority file for every session.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
I figured it out finally !
The change I made was my choice of login manager. I switched to kdm and it was disabling users other than the currently logged in one access to the display.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
I figured it out finally !
The change I made was my choice of login manager. I switched to kdm and it was disabling users other than the currently logged in one access to the display.
I have this issue at the moment too, so how does one fix it exactly?
Offline