SU in shell

SU in shell

Post by INGRP Eli Sheena 522 » Wed, 20 Nov 1996 04:00:00



Hi

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/*' << !
$PASSWD
!

I want it will be independent with other files
I hop someone know how to do it

 Thanks
        Eli Sheena

 
 
 

SU in shell

Post by Igor Vulfso » Thu, 21 Nov 1996 04:00:00



Quote:

> Hi

> 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/*' << !
> $PASSWD
> !

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.

iv
--

Operations Research   |  URL:   <http://www.magibox.net/~unabest/>
Federal Express Corp  |  Voice: (901) 395-7358

 
 
 

1. su 'ed shell or regular shell

How would I find out if the shell that is executing a command is a regular
shell or shell started by su.
 What I am trying to achieve is to allow only one particular userid to run
a executable. Problem is that people can su into this account and execute
that command.

Thanks in advance.

2. Closing Serial Ports??

3. shell built ins

4. study English

5. Shells and built-ins

6. Customizing CDE login screen

7. su: no shell

8. Domain names/local network

9. passing shell env when su root performed

10. su no shell

11. transfering the "history" of a normal user to the su-shell possible

12. Where does the "su" shell get its path?

13. su doesn't read user's shell init files?