You are not logged in.

#1 2008-02-02 14:37:19

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Why do things just stop working ? Mysterious errors..

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

#2 2008-02-02 15:37:34

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: Why do things just stop working ? Mysterious errors..

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

#3 2008-02-02 16:01:37

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Why do things just stop working ? Mysterious errors..

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

#4 2008-02-02 16:18:22

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Why do things just stop working ? Mysterious errors..

DonVla wrote:

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.

patroclo7 wrote:

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

#5 2008-02-02 16:21:08

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: Why do things just stop working ? Mysterious errors..

Have you updated your nvidia driver recently? (If you have a nvidia card that ís)

Offline

#6 2008-02-02 16:25:55

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Why do things just stop working ? Mysterious errors..

I know that there are xinitscripts around which fiddle with xhost (the tool of the above workaround smile ).

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

#7 2008-02-02 16:44:49

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Why do things just stop working ? Mysterious errors..

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

#8 2008-02-02 17:13:55

brandemk
Member
Registered: 2008-01-19
Posts: 11

Re: Why do things just stop working ? Mysterious errors..

moljac024 wrote:

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

#9 2008-02-02 17:20:06

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Why do things just stop working ? Mysterious errors..

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

#10 2008-02-02 17:51:51

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Why do things just stop working ? Mysterious errors..

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

#11 2008-02-02 17:55:43

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Why do things just stop working ? Mysterious errors..

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. tongue
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 wink

That is all to say: use sudo! big_smile


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

#12 2008-02-02 18:10:44

May-C
Member
Registered: 2007-12-28
Posts: 83

Re: Why do things just stop working ? Mysterious errors..

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

#13 2008-02-02 18:41:07

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Why do things just stop working ? Mysterious errors..

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

#14 2008-02-02 18:43:25

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Why do things just stop working ? Mysterious errors..

First of all, thanks for the replies everyone! smile

brandemk wrote:

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 smile

finferflu wrote:

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 smile

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

#15 2008-02-02 18:51:40

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: Why do things just stop working ? Mysterious errors..

Not to jack the topic, but I've been able to run apps as root using su for ages o_o (I don't think I did anything special)


Website - Blog - arch-home
Arch User since March 2005

Offline

#16 2008-02-02 18:54:11

brandemk
Member
Registered: 2008-01-19
Posts: 11

Re: Why do things just stop working ? Mysterious errors..

moljac024 wrote:

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)

moljac024 wrote:

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. smile

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

#17 2008-02-02 18:59:06

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Why do things just stop working ? Mysterious errors..

But anyone can hit the power button which is way worse , isn't it ? smile


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

#18 2008-02-02 19:07:44

jacko
Member
Registered: 2007-11-23
Posts: 840

Re: Why do things just stop working ? Mysterious errors..

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

#19 2008-02-02 19:08:42

jacko
Member
Registered: 2007-11-23
Posts: 840

Re: Why do things just stop working ? Mysterious errors..

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

#20 2008-02-02 19:46:41

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Why do things just stop working ? Mysterious errors..

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

#21 2008-02-02 19:51:44

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: Why do things just stop working ? Mysterious errors..

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

#22 2008-02-02 20:54:37

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Why do things just stop working ? Mysterious errors..

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

#23 2008-02-02 21:04:21

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Why do things just stop working ? Mysterious errors..

I figured it out finally ! smile

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. smile


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

#24 2008-02-03 01:51:19

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: Why do things just stop working ? Mysterious errors..

moljac024 wrote:

I figured it out finally ! smile

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. smile

I have this issue at the moment too, so how does one fix it exactly?

Offline

#25 2008-02-03 01:56:55

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: Why do things just stop working ? Mysterious errors..

use startx ^^ big_smile


Website - Blog - arch-home
Arch User since March 2005

Offline

Board footer

Powered by FluxBB