Commands executed using JSch behaves differently than in SSH terminal (bypasses confirm prompt message of “yes/”no")

前端 未结 1 1279
春和景丽
春和景丽 2020-12-06 23:34

Note: I log into a device, not a computer, so I login to configuration mode (instead of non configuration mode).

I am using JSch library in Java, to login with an SS

相关标签:
1条回答
  • 2020-12-07 00:06

    By default the JSch does not request PTY (pseudo-terminal).

    That can cause some commands to behave differently than in an interactive SSH terminal.

    You can override this using the ChannelSession.setPty.


    If the above does not help, see also similar questions:

    • Certain Unix commands fail with "... not found", when executed through Java using JSch
    • Certain Unix commands fail with "... not found", when executed through Java using JSch even with setPty enabled
    0 讨论(0)
提交回复
热议问题