angie ahl schrieb:
Hi
Hi
I'm hoping someone can point me at the right manual/commands
I'm trying to work out how to copy a directory (and contents) owned by
one user (user1) into a directory owned by another (user2).
user1 is user admin and group wheel BTW. The user the files are being
copied to is more restriced. The files being copied are world
readable.
I can do this successfully on the command line like so:
su user2 -c 'cp -R /user1path/conf /user2path/conf'
but of course I need to enter the pw for user2 (which is available in
my perl script as it just set it up)
Does anyone have any pointers on how to read/write to the shell to do this.
Ideally I'd like to su user2 and then issue a series of cp commands etc.
This is being run from a cgi script that's running under suexec so I
have to be careful with permissions. I can't just run the whole thing
under root (and I don't need root privs for this)
Thanks so much
Angie
Have a look at [1], it describes everything way better than I could. Or
have a look at sudo (which seems the better way to me as you don't have
to save any passwords).
[1] http://www.unix.org.ua/orelly/perl/cookbook/ch16_05.htm
Elvis
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>