ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: execute command as root
Date Wed, 21 Apr 2004 17:03:58 GMT
You should setup a sudo permision and execute the command via sudo.

-Rob Anderson

> -----Original Message-----
> From: stevecanfield@yahoo.com [mailto:stevecanfield@yahoo.com]
> 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 <gudnabrsam@yahoo.com> 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
> > 
> > --- stevecanfield@yahoo.com 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:
> > > user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail:
> > > user-help@ant.apache.org
> > > 
> > 
> > 
> > 
> > 	
> > 		
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Photos: High-quality 4x6 digital prints for
> > 25¢
> > http://photos.yahoo.com/ph/print_splash
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> 
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25¢
> http://photos.yahoo.com/ph/print_splash
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message