Re: [gentoo-user] Re: X programs as root

2010-10-17 Thread Kevin O'Gorman
On Mon, Oct 4, 2010 at 10:22 PM, Andrey Vul andrey@gmail.com wrote:

 sudoers(5):
 ...
 ## Run X applications through sudo
 Defaults env_keep += DISPLAY HOME
 ...

 sudo visudo; paste; done


Except that in the heavily-commented version of the sudoers file that I
have, the corresponding line does not include the DISPLAY variable, and it
happens to work fine that way.  Try just keeping HOME.



-- 
Kevin O'Gorman, PhD


Re: [gentoo-user] Re: X programs as root

2010-10-17 Thread Alan McKinnon
Apparently, though unproven, at 15:03 on Sunday 17 October 2010, Nikos 
Chantziaras did opine thusly:

 On 10/17/2010 04:00 PM, Nikos Chantziaras wrote:
  On 09/22/2010 09:48 PM, Andrey Vul wrote:
  When I launch X programs via sudo, I get the following:
  
  $sudo gui-admin
  No protocol specified
  gui-admin: cannot connect to X server :0
  
  ( Assume gui-admin is an X program )
  
  But (gk|kde)su(do)? works. This is somewhat confusing.
  
  I just discovered something. Keeping HOME is not really recommended,
  because the programs that run as root will then use your user's
  configuration files and sometimes will set 'root' as their owner. As you
  can imagine, this is not a good thing.
  
  It seems what X programs really need is the .Xauthority file of the
  current X session. All you have to do is add this line to your ~/.bashrc:
  
  export XAUTHORITY=$HOME/.Xauthority
  
  Then you don't have to configure sudoers to keep the HOME env var.
 
 (I have the tendency to press the Send button too soon...)
 
 Setting XAUTHORITY in the user's .bashrc also means that you don't have
 to modify /etc/sudoers *in any way*, not even DISPLAY needs to be kept.
   Setting XAUTHORITY is *all* what is needed.


I owe you a beer :-)

One little export and this annoying thingy has now gone away:

$ sudo vi /etc/fstab 
Password: 
No protocol specified


You have NO IDEA how long that has annoyed me and how long I've been searching 
for a solution. Make that two beers!


-- 
alan dot mckinnon at gmail dot com



Re: [gentoo-user] Re: X programs as root

2010-10-17 Thread Kevin O'Gorman
On Sun, Oct 17, 2010 at 8:37 AM, Alan McKinnon alan.mckin...@gmail.comwrote:

 Apparently, though unproven, at 15:03 on Sunday 17 October 2010, Nikos
 Chantziaras did opine thusly:

  On 10/17/2010 04:00 PM, Nikos Chantziaras wrote:
   On 09/22/2010 09:48 PM, Andrey Vul wrote:
   When I launch X programs via sudo, I get the following:
  
   $sudo gui-admin
   No protocol specified
   gui-admin: cannot connect to X server :0
  
   ( Assume gui-admin is an X program )
  
   But (gk|kde)su(do)? works. This is somewhat confusing.
  
   I just discovered something. Keeping HOME is not really recommended,
   because the programs that run as root will then use your user's
   configuration files and sometimes will set 'root' as their owner. As
 you
   can imagine, this is not a good thing.
  
   It seems what X programs really need is the .Xauthority file of the
   current X session. All you have to do is add this line to your
 ~/.bashrc:
  
   export XAUTHORITY=$HOME/.Xauthority
  
   Then you don't have to configure sudoers to keep the HOME env var.
 
  (I have the tendency to press the Send button too soon...)
 
  Setting XAUTHORITY in the user's .bashrc also means that you don't have
  to modify /etc/sudoers *in any way*, not even DISPLAY needs to be kept.
Setting XAUTHORITY is *all* what is needed.


 I owe you a beer :-)

 One little export and this annoying thingy has now gone away:

 $ sudo vi /etc/fstab
 Password:
 No protocol specified


 You have NO IDEA how long that has annoyed me and how long I've been
 searching
 for a solution. Make that two beers!

 I'm a bit surprised, but this fix actually does work, even without any
special arrangement to
env_keep XAUTHORITY.  But I still don't like it any better than my own
solution

echo -n .mybashrc: 
xhost +r...@localhost

which I place in my .mybashrc, where I keep all of my .bashrc
customizations.  My way, it can
remind me what's going on, and seems more direct.  It also works if I su
to root.  As an old-timer on Unix, I often forget sudo.  I don't like it
much anyway because it won't get me into root if something goes wrong in
bootup: with this in mind, I need a root PW anyway, until that bottleneck
gets fixed.

The above form is actually only used in a debugging mode I've defined, and
is silent otherwise.

++ kevin

-- 
Kevin O'Gorman, PhD


Re: [gentoo-user] Re: X programs as root

2010-10-05 Thread Andrey Vul
sudoers(5):
...
## Run X applications through sudo
Defaults env_keep += DISPLAY HOME
...

sudo visudo; paste; done

--
Andrey m05hbear Vul



Re: [gentoo-user] Re: X programs as root

2010-09-27 Thread Helmut Jarausch
On 09/25/10 01:35:16, Nikos Chantziaras wrote:
...
 
 But if some reason you want sudo, /etc/sudoers has some info:
 
## Run X applications through sudo
 
 Read the comments there and uncomment what suits you.  Did I mention 
 that you should use kdesu instead of sudo? :-P

Which version of sudo are you talking about?
I have sudo-1.7.4p4 installed here but I don't see any mentioning of 
X11 in sample.sudoers

Thanks for a pointer,
Helmut.




Re: [gentoo-user] Re: X programs as root

2010-09-26 Thread Dale

Dale wrote:


It appears that maybe portage got the order wrong or something was 
amiss with KDE.  I re-emerged the following:


kdebase-menu
kdebase-menu-icons
kmenuedit
kdesu

After that, it works again.  So, either something was built in the 
wrong order or KDE had some issue with something.  Oh, no config files 
to update after that either.


Don't know what fixed it exactly but at least it works again.  Maybe 
the OP should try rebuilding some packages too?  May help, may not.


Dale

:-)  :-)


I spoke to soon I guess.  I was gone for a while so I cut my puter off.  
Now, the programs don't work as root again even after recompiling those 
packages again.


This is weird.  Works one time then stops again.

Dale

:-)  :-)



Re: [gentoo-user] Re: X programs as root

2010-09-26 Thread Robin Atwood
On Sunday 26 September 2010, Dale wrote:
 Dale wrote:
  It appears that maybe portage got the order wrong or something was
  amiss with KDE.  I re-emerged the following:
  
  kdebase-menu
  kdebase-menu-icons
  kmenuedit
  kdesu
  
  After that, it works again.  So, either something was built in the
  wrong order or KDE had some issue with something.  Oh, no config files
  to update after that either.
  
  Don't know what fixed it exactly but at least it works again.  Maybe
  the OP should try rebuilding some packages too?  May help, may not.
  
  Dale
  
  :-)  :-)
 
 I spoke to soon I guess.  I was gone for a while so I cut my puter off.
 Now, the programs don't work as root again even after recompiling those
 packages again.
 
 This is weird.  Works one time then stops again.

I always run several apps under kdesu and sometimes they don't start. Once I 
did an strace and found it hanging opening /var/tmp/kdecache-user; deleting 
all those solved the problem. 

HTH
-Robin
-- 
--
Robin Atwood.

Ship me somewheres east of Suez, where the best is like the worst,
 Where there ain't no Ten Commandments an' a man can raise a thirst
 from Mandalay by Rudyard Kipling
--











Re: [gentoo-user] Re: X programs as root

2010-09-26 Thread Dale

Robin Atwood wrote:

On Sunday 26 September 2010, Dale wrote:
   

Dale wrote:
 

It appears that maybe portage got the order wrong or something was
amiss with KDE.  I re-emerged the following:

kdebase-menu
kdebase-menu-icons
kmenuedit
kdesu

After that, it works again.  So, either something was built in the
wrong order or KDE had some issue with something.  Oh, no config files
to update after that either.

Don't know what fixed it exactly but at least it works again.  Maybe
the OP should try rebuilding some packages too?  May help, may not.

Dale

:-)  :-)
   

I spoke to soon I guess.  I was gone for a while so I cut my puter off.
Now, the programs don't work as root again even after recompiling those
packages again.

This is weird.  Works one time then stops again.
 

I always run several apps under kdesu and sometimes they don't start. Once I
did an strace and found it hanging opening /var/tmp/kdecache-user; deleting
all those solved the problem.

HTH
-Robin
   


I was about to post this.  I logged out of KDE and went to single user.  
I then used ps to list the processes and there was still a kdesu 
running.  I killed it and a couple other left overs, then logged back in 
and everything is working again.  It looks like KDE needs to do a little 
more clean up when logging out.


I did clear some config files and cache files once before.  I lost 
bookmarks somehow.  I need to save those somewhere so I can restore 
them.  ;-)


Dale

:-)  :-)



Re: [gentoo-user] Re: X programs as root

2010-09-25 Thread Volker Armin Hemmann
On Saturday 25 September 2010, Dale wrote:
 Nikos Chantziaras wrote:
  On 09/23/2010 04:18 AM, Dale wrote:
  Nikos Chantziaras wrote:
  On 09/22/2010 09:48 PM, Andrey Vul wrote:
  When I launch X programs via sudo, I get the following:
  
  $sudo gui-admin
  No protocol specified
  gui-admin: cannot connect to X server :0
  
  ( Assume gui-admin is an X program )
  
  But (gk|kde)su(do)? works. This is somewhat confusing.
  
  sudo doesn't keep the $DISPLAY environment variable by default. There
  could be other issues too. Best stick to kdesu and friends; that's
  what they are there for.
  
  Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work
  either. It worked before but not now. I'm not sure what changed between
  4.4 and 4.5.1 but it broke my konqueror as root and other programs as
  well. Still have some I haven't tried tho. Konqueror is the one I need
  most. Oh, I can get Dolphin to work tho. The conspiracy theory part in
  me is starting to think.
  
  Sure would like to get this working again too.
  
  Again, use kdesu, not sudo.
  
  But if some reason you want sudo, /etc/sudoers has some info:
## Run X applications through sudo
  
  Read the comments there and uncomment what suits you.  Did I mention
  that you should use kdesu instead of sudo? :-P
 
 Well, I don't really know what it is using.  I just set up the menu item
 to run the program as root.  I don't know if it uses su -, kdesu, sudo
 or what.  I just know it worked until the upgrade a few days ago.
 
 Since KDE proclaimed this was supposed to be ready for widespread use
 and cut off KDE3, I sure do wish they would make up their mind HOW
 things are going to work.  I would think they need to know that before
 claiming something was ready for widespread use.  Makes me want to go
 back to KDE 3.5.  At least I could get everything I need to work and
 survive a upgrade too.  ;-)
 
 Oh well.  This is the new normal for KDE I guess.  lol
 
 Dale
 
 :-)  :-)

I don't know what  you are talking about. Setting up menu items? wtf?



Re: [gentoo-user] Re: X programs as root

2010-09-25 Thread Yohan Pereira
On Saturday 25 September 2010 8:33:09 am Dale wrote:
 Well, I don't really know what it is using.  I just set up the menu item
 to run the program as root. 

i assume you mean you setup a menuitem to run a paticular application as root 
like say to run konsole/konqueror as root.

 I don't know if it uses su -, kdesu, sudo

if its a menu item then it has to use kdesu, because sudo and su both take the 
password from teh std input (you wont get a gui prompt to enter the password), 
and nothing will happen. all you have to do is fire up the menu editor, go to 
your menu entry and make sure the command field looks like this kdesu 
konsole, if it does look like that , try running kdesu from a konsole session 
and see what it prints out (it may not be installed for starters).

-- 
- Yohan Pereira.



Re: [gentoo-user] Re: X programs as root

2010-09-25 Thread Dale

Volker Armin Hemmann wrote:

On Saturday 25 September 2010, Dale wrote:
   

Nikos Chantziaras wrote:
 

On 09/23/2010 04:18 AM, Dale wrote:
   

Nikos Chantziaras wrote:
 

On 09/22/2010 09:48 PM, Andrey Vul wrote:
   

When I launch X programs via sudo, I get the following:

$sudo gui-admin
No protocol specified
gui-admin: cannot connect to X server :0

( Assume gui-admin is an X program )

But (gk|kde)su(do)? works. This is somewhat confusing.
 

sudo doesn't keep the $DISPLAY environment variable by default. There
could be other issues too. Best stick to kdesu and friends; that's
what they are there for.
   

Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work
either. It worked before but not now. I'm not sure what changed between
4.4 and 4.5.1 but it broke my konqueror as root and other programs as
well. Still have some I haven't tried tho. Konqueror is the one I need
most. Oh, I can get Dolphin to work tho. The conspiracy theory part in
me is starting to think.

Sure would like to get this working again too.
 

Again, use kdesu, not sudo.

But if some reason you want sudo, /etc/sudoers has some info:
   ## Run X applications through sudo

Read the comments there and uncomment what suits you.  Did I mention
that you should use kdesu instead of sudo? :-P
   

Well, I don't really know what it is using.  I just set up the menu item
to run the program as root.  I don't know if it uses su -, kdesu, sudo
or what.  I just know it worked until the upgrade a few days ago.

Since KDE proclaimed this was supposed to be ready for widespread use
and cut off KDE3, I sure do wish they would make up their mind HOW
things are going to work.  I would think they need to know that before
claiming something was ready for widespread use.  Makes me want to go
back to KDE 3.5.  At least I could get everything I need to work and
survive a upgrade too.  ;-)

Oh well.  This is the new normal for KDE I guess.  lol

Dale

:-)  :-)
 

I don't know what  you are talking about. Setting up menu items? wtf?

   


I run my programs through the K menu thingy.  You know, at the bottom 
left of the screen.  I may be doing mine different but it seems KDE 
doesn't want much of anything being run as root, not the way you are 
trying to do it, not the way I have been doing it.


Still puzzled that Dolphin will work but Konqueror does not.

Dale

:-)  :-)



Re: [gentoo-user] Re: X programs as root

2010-09-25 Thread Dale

Yohan Pereira wrote:

On Saturday 25 September 2010 8:33:09 am Dale wrote:
   

Well, I don't really know what it is using.  I just set up the menu item
to run the program as root.
 

i assume you mean you setup a menuitem to run a paticular application as root
like say to run konsole/konqueror as root.

   

I don't know if it uses su -, kdesu, sudo
 

if its a menu item then it has to use kdesu, because sudo and su both take the
password from teh std input (you wont get a gui prompt to enter the password),
and nothing will happen. all you have to do is fire up the menu editor, go to
your menu entry and make sure the command field looks like this kdesu
konsole, if it does look like that , try running kdesu from a konsole session
and see what it prints out (it may not be installed for starters).

   


You are assuming correctly above.  The way I have always had to set this 
up is like this.  Set up the menu item like I would with any other 
user.  In the Advanced tab, I set it to run as user root.  When I then 
select to run the item from the menu, a little GUI window will pop up 
and ask me for the root password.  This has worked in KDE3 for ages and 
I don't recall having any trouble with it all.  KDE4 has been changing 
things around and I have had to rework things a couple times as KDE4 
seems to keep changing the way things work.


I suspect you may be right, that it uses kdesu.  Just to make sure it 
wasn't a wrong version installed, this is what I have:


r...@smoker / # equery list -p kdesu
 * Searching for kdesu ...
[-P-] [  ] kde-base/kdesu-4.4.5:4.4
[IP-] [  ] kde-base/kdesu-4.5.1:4.5
r...@smoker / #

So, I do have the latest at least.  I'll try to re-emerge it although I 
think I already did that once.  I know I tried re-emerging some other 
packages trying to get this to work again.


What gets me, I have Dolphin set up the same way, it works just fine.  I 
can also run Konqueror from a root Konsole and it works fine there.  It 
just doesn't like the menu item for some reason.  I suspect it doesn't 
like kdesu for some reason.  Maybe it's a bug and will be fixed or it 
may be a new feature.  Who knows.


Dale

:-)  :-)



Re: [gentoo-user] Re: X programs as root

2010-09-25 Thread Yohan Pereira
On Saturday 25 September 2010 2:51:45 pm Dale wrote: 
 In the Advanced tab, I set it to run as user root.  When I then
 select to run the item from the menu, a little GUI window will pop up
 and ask me for the root password.  
 
i just tried that and it worked perfectly for konqueror, maybe you can try 
deleting that menu entry and recreating it. 

if that dosnt work try running kdesu konqueror in a konsole session and see 
what happns.

-- 
- Yohan Pereira.



Re: [gentoo-user] Re: X programs as root

2010-09-25 Thread Dale

Yohan Pereira wrote:

On Saturday 25 September 2010 2:51:45 pm Dale wrote:
   

In the Advanced tab, I set it to run as user root.  When I then
select to run the item from the menu, a little GUI window will pop up
and ask me for the root password.
 


i just tried that and it worked perfectly for konqueror, maybe you can try
deleting that menu entry and recreating it.

if that dosnt work try running kdesu konqueror in a konsole session and see
what happns.

   


It appears that maybe portage got the order wrong or something was amiss 
with KDE.  I re-emerged the following:


kdebase-menu
kdebase-menu-icons
kmenuedit
kdesu

After that, it works again.  So, either something was built in the wrong 
order or KDE had some issue with something.  Oh, no config files to 
update after that either.


Don't know what fixed it exactly but at least it works again.  Maybe the 
OP should try rebuilding some packages too?  May help, may not.


Dale

:-)  :-)



Re: [gentoo-user] Re: X programs as root

2010-09-24 Thread Andrey Vul
On Wed, Sep 22, 2010 at 21:18, Dale rdalek1...@gmail.com wrote:
 Nikos Chantziaras wrote:

 On 09/22/2010 09:48 PM, Andrey Vul wrote:

 When I launch X programs via sudo, I get the following:

 $sudo gui-admin
 No protocol specified
 gui-admin: cannot connect to X server :0

 ( Assume gui-admin is an X program )

 But (gk|kde)su(do)? works. This is somewhat confusing.

 sudo doesn't keep the $DISPLAY environment variable by default.  There
 could be other issues too.  Best stick to kdesu and friends; that's what
 they are there for.


It's the other issues.


 Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work
 either.  It worked before but not now.  I'm not sure what changed between
 4.4 and 4.5.1 but it broke my konqueror as root and other programs as well.
  Still have some I haven't tried tho.  Konqueror is the one I need most.
  Oh, I can get Dolphin to work tho.  The conspiracy theory part in me is
 starting to think.

Same here, s/konqueror/every gui program run via sudo/

 Sure would like to get this working again too.
Ditto. VMware tools, etc, are all gui and sometimes sudo is eaiser to
use than kdesu.



Re: [gentoo-user] Re: X programs as root

2010-09-24 Thread Dale

Nikos Chantziaras wrote:

On 09/23/2010 04:18 AM, Dale wrote:

Nikos Chantziaras wrote:

On 09/22/2010 09:48 PM, Andrey Vul wrote:

When I launch X programs via sudo, I get the following:

$sudo gui-admin
No protocol specified
gui-admin: cannot connect to X server :0

( Assume gui-admin is an X program )

But (gk|kde)su(do)? works. This is somewhat confusing.


sudo doesn't keep the $DISPLAY environment variable by default. There
could be other issues too. Best stick to kdesu and friends; that's
what they are there for.




Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work
either. It worked before but not now. I'm not sure what changed between
4.4 and 4.5.1 but it broke my konqueror as root and other programs as
well. Still have some I haven't tried tho. Konqueror is the one I need
most. Oh, I can get Dolphin to work tho. The conspiracy theory part in
me is starting to think.

Sure would like to get this working again too.


Again, use kdesu, not sudo.

But if some reason you want sudo, /etc/sudoers has some info:

  ## Run X applications through sudo

Read the comments there and uncomment what suits you.  Did I mention 
that you should use kdesu instead of sudo? :-P





Well, I don't really know what it is using.  I just set up the menu item 
to run the program as root.  I don't know if it uses su -, kdesu, sudo 
or what.  I just know it worked until the upgrade a few days ago.


Since KDE proclaimed this was supposed to be ready for widespread use 
and cut off KDE3, I sure do wish they would make up their mind HOW 
things are going to work.  I would think they need to know that before 
claiming something was ready for widespread use.  Makes me want to go 
back to KDE 3.5.  At least I could get everything I need to work and 
survive a upgrade too.  ;-)


Oh well.  This is the new normal for KDE I guess.  lol

Dale

:-)  :-)



Re: [gentoo-user] Re: X programs as root

2010-09-22 Thread Dale

Nikos Chantziaras wrote:

On 09/22/2010 09:48 PM, Andrey Vul wrote:

When I launch X programs via sudo, I get the following:

$sudo gui-admin
No protocol specified
gui-admin: cannot connect to X server :0

( Assume gui-admin is an X program )

But (gk|kde)su(do)? works. This is somewhat confusing.


sudo doesn't keep the $DISPLAY environment variable by default.  There 
could be other issues too.  Best stick to kdesu and friends; that's 
what they are there for.





Well, I noticed after the recent upgrade to 4.5.1 that mine doesn't work 
either.  It worked before but not now.  I'm not sure what changed 
between 4.4 and 4.5.1 but it broke my konqueror as root and other 
programs as well.  Still have some I haven't tried tho.  Konqueror is 
the one I need most.  Oh, I can get Dolphin to work tho.  The conspiracy 
theory part in me is starting to think.


Sure would like to get this working again too.

Dale

:-)  :-)