> I write script in shell and I want to do a command as other user
> but I want that it will be with out asking for password
> I try the following
> su $LOGIN -c 'chown suscarft:sus /tmp/drop/*' << !
You have 3 options:
1) Save password in some file - very risky.
2) Make the file that contains the su command into user-id-0 script
(look at man pages on chmod on how to do that - file would
have permissions set to rwsr-xr-x - note the 's' inxtead of 'x').
3) Make the user in the same group as root, so that they could do
newgrp to root's group.
Operations Research | URL: <http://www.magibox.net/~unabest/>
Federal Express Corp | Voice: (901) 395-7358