0

My requirement is as follow:

I have to login to Unix box using my credentials and once login, I have to do su to different user. I need to provide password and reason for scsu command. once su successful, I have to run set of commands one after another as that user.

On completion of executions, close channel and session both.

I tried to use Shell channel but I am able to fire scsu only ... need help to complete remaining requirement of executions of command and closing channel

  • 1
    Nice project, have you tried something? – Alexandre Lavoie May 20 '13 at 23:37
  • yes, i tried shell channel and i was able to do su and able to pass password and reason. then i send command using out.write().... but all my command were passed in one go. though they got executed one after another. i am facing issue with channel.disconnect as it didn't wait for all command to execute and it closed connection. – user2403496 May 21 '13 at 12:08
  • Please provide a gist (maybe a code snippet) of how you where able to pass the password to the shell for the su command. I'm looking for a solution. http://stackoverflow.com/a/16499330/1917804 – Vishnu Prasad Kallummel Sep 15 '14 at 11:20

0 Answers0