Fake sudo?

pgf at laptop.org pgf at laptop.org
Wed Nov 26 10:32:17 EST 2008


gary c martin wrote:
 > 
 > 	 "standard in must be a tty"
 > 
 > After much poking I discovered sudo on the XO was a custom script  
 > using su (su does not allow non ttys to become privileged, only the  
 > real sudo).
 > 
 > Just curious as to the need for this change, though any hints to a  
 > workaround would be much appreciated :-) I'm assuming it was added for  
 > something security related, as a yum install of the real sudo seems to  
 > suggest it's just an extra ~200k (though it fails to install due to a  
 > conflict with olpcsudo-1.2-1.noarch).

as i understand it, the script is a result of some older releases
going out using su, later releases going out using sudo, but that
change broke compatibility with the "su"-based releases, so scott's
reimplementation was an attempt to combine the commonly use cases
into one script.  i hit the "must be a tty" issue as well -- i've
used this really ugly workaround
    xterm -e 'su -c "command1; command2"'
since that provides the needed tty but i'm sure (or, rather, i
hope) there's a better way.

(this works for me because the commands are run from my .xsession.
in your case (remote via ssh) you'd need to set DISPLAY to
localhost:0 for this to work, and you might need an "xhost +"
beforehand to allow that.  not sure.  ymmv.)

paul
=---------------------
 paul fox, pgf at laptop.org
 give one laptop, get one laptop --- http://www.amazon.com/xo



More information about the Devel mailing list