"R. Quenett" wrote: > from Alan Jackson: > > " Here is a script I use... > > " su root -c "make install UNINST=1" > > Right here, mine prompts me for my root password. Obviously, yours > doesn't. I wonder what the difference is, I recall trying -c... > hmmm. I will try it again. Thanks.
Well, the -c just says that what comes next is the command for su to run, rather than run an interactive shell. I don't know how to script the password to su (I'm sure there are several tricks you could use, but su isn't likely to make it easy). The issue is that you are trying to increase the priviledge of your script, and that requires a password, or it's a big security hole. Typically, programs that do this do it the other way round. They start as root and do the sensitive stuff first, then drop priviledge and continue. In your script, you could run it as root (or suid), and preface all the 'joeuser' commands with "su joeuser -c ". Or you could put all the non-root commands in a separate script and just run that from the root one with su. HTH. Dave _______________________________________________ Linux-users mailing list Archives, Digests, etc at http://linux.nf/mailman/listinfo/linux-users