Switching users in a bash script?

lynx.abraxas at freenet.de lynx.abraxas at freenet.de
Tue Aug 29 10:32:37 PDT 2006


On 29/08/06 00:12:00, Brandon Peirce wrote:
> >I  have never seen this technique before. But being curious I tried it too 
> >and
> >am getting:
> >
> >su: must be run from a terminal
> >
> >Are there different implementations of su out there? I have an LFS 5.1.1
> 
> There is an su command in Coreutils and in Shadow.  The one from coreutils 
> sucks.
> 
> Ever since I can remember LFS suppresses the coreutils one and installs the 
> shadow
> one, but maybe the suppression technique has changed.  Also, LFS 5.1.1 is 
> probably
> from the time before the merge of sh-utils and textutils into coreutils, so 
> you
> should best go back and look at the relevant chapters of the 5.1.1 book in 
> the LFS
> museum.  If you skipped the supression command you might have ended up with
> the wrong version.
> 
> Running 'su --version' might help you to indentify your binary.  Recent 
> coreutils
> versions will respect that switch and clearly print out that it is from 
> coreutils.
> Recent shadow versions will complain that it's an unrecognized option and 
> print
> a usage message.  I also have an older su binary lurking on my box (probably
> from the shadow version used in LFS 4.0) which treats the --version arg as
> the user name to su to, and will prompt for a password.

It seems I have su from shadow-4.0.14. It gives a usage message with --version. Is it really the shadow-su that accepts this pipe input?

Lynx



More information about the lfs-support mailing list