java - Commands executed using JSch behaves differently than in SSH terminal (bypasses confirm prompt message of "yes/"no") -
note: log device, not computer, login configuration mode (instead of non configuration mode).
i using jsch library in java, login ssh protocol. login this:
channel = con.openchannel("shell"); channel.connect();
in cases, when send through shell command needs su
(configuration mode) permissions (change configuration), code bypasses prompt confirmation message of - may prevent other users changing configuration. while if enter command manually ssh client/terminal, have enter yes confirmation.
does have idea why?
thanks.
[]
when log in through jsch can configuration commands even, when don't insert "yes" array of commands executed.
by default jsch not request pty (pseudo-terminal).
that can cause commands behave differently in interactive ssh terminal.
you can override using channelsession.setpty
.
if above not help, see similar questions:
Comments
Post a Comment