AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
Expand all | Collapse all

How to pass the sudo command in script ??

  • 1.  How to pass the sudo command in script ??

    Posted Mon April 18, 2011 07:42 AM

    Originally posted by: Atul.Singh


    Hi All

    I m trying to write a auto login script which is capable to login to AIX and sudo to other user and able to transfer the file on the local machine ??

    I already write the login script but unable to sudo to other user ?

    here is the prepared BAT file

    plink.exe -ssh -P 22 SERVER_NAME -l USER_ID -pw PASSWORD -m cmds.txt

    cmds.txt is the file which have the commands which u want to run on AIX server. When I put the sudo in this file, it gaves a error, "no tty present" But when I manually put the command it works ???

    help me

    Atul Singh


  • 2.  Re: How to pass the sudo command in script ??

    Posted Mon April 18, 2011 08:59 AM

    Originally posted by: shyhc


    You might try passing -t "enable pseudo tty" to plink
    • stefan