You should setup a sudo permision and execute the command via sudo. -Rob Anderson
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 21, 2004 10:02 AM > To: Ant Users List > Subject: Re: execute command as root > > > AFAIK, you cannot pipe a password to su. I think this > is for security reasons. > > > > --- Matt Benson <[EMAIL PROTECTED]> wrote: > > Don't you need to pipe a password to su? You could > > do > > that using exec's inputstring (or to redirect from a > > file, input) attribute... or for another idea, you > > could put the chown into a shell script owned by > > root > > and turn on SETUID for the shell script. At least > > this way you don't store root's password anyway and > > you can control access to the script with groups... > > you could also look into the kinds of things you can > > do with sudo... > > > > -Matt > > > > --- [EMAIL PROTECTED] wrote: > > > I have a script that needs to chown some files as > > > root, but I don't want to have to execute > > everything > > > as root. I've been trying to use 'su' with no > > > success. > > > Any ideas? I've been trying variations on the > > > following: > > > <exec executable="su"> > > > <arg value="-c 'chown -R someUser /var/tomcat' > > > root"/> > > > </exec> > > > > > > I've also tried running it from a shell: > > > <exec executable="sh"> > > > <arg line="su -c 'chown -R someUser > > /var/tomcat' > > > root"/> > > > </exec> > > > > > > Should I be able to do something like this? I > > either > > > get an error telling me that su wants input from > > > stdin > > > or that sh cannot run an executable. > > > > > > -sc > > > > > > > > > > > > > > > __________________________________ > > > Do you Yahoo!? > > > Yahoo! Photos: High-quality 4x6 digital prints for > > > 25� > > > http://photos.yahoo.com/ph/print_splash > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > __________________________________ > > Do you Yahoo!? > > Yahoo! Photos: High-quality 4x6 digital prints for > > 25� > > http://photos.yahoo.com/ph/print_splash > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Photos: High-quality 4x6 digital prints for 25� > http://photos.yahoo.com/ph/print_splash > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
