Use JSch sudo example and Channel.setPty for running sudo command on remote host

后端 未结 3 1997
再見小時候
再見小時候 2020-12-01 17:54

I have used JSch Sudo example under following link:

http://www.jcraft.com/jsch/examples/Sudo.java.html

And changed it a bit and get rid of all the dialogs as

3条回答
  •  臣服心动
    2020-12-01 18:08

    After setting

    ((ChannelExec) channel).setPty(true)
    

    the reported problem have in my code got solved.

提交回复
热议问题