On Tue, 29 Dec 2015 16:01:15 +0100, Peter Hunkeler wrote:
>
>To run commands in a "su" shell environment, you have to write all the 
>commands into a UNIX file first, and then call "su" by redirecting stdin to 
>that UNIX file.
>
>echo "id" > /tmp/sucommandfile
>su < /tmp/sucommandfile
>
>This will show uid=0, because it is the sub shell (uid=0), which is reading 
>from /tmp/sucommandfile as if it was stdin, and execute the commands found 
>therein.
> 
Did this work for you on z/OS?  Looking for alternatives on a Linux system
(I haven't su on z/OS):

501 $ echo id | su
su: must be run from a terminal
502 $

It's a security feature.  But:

500 $ sudo sh -c id
[sudo] password for ********:
uid=0(root) gid=0(root) groups=0(root)
501 $
500 $ echo id | sudo sh
[sudo] password for ********: 
uid=0(root) gid=0(root) groups=0(root)
501 $

... and I belive sudo is now available in Ported Tools.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to