Running commands over ssh with Java

后端 未结 6 548
北荒
北荒 2020-12-05 16:06

Scenerio: I\'d like to run commands on remote machines from a Java program over ssh (I am using OpenSSH on my development machine). I\'d also like to make the ssh connecti

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 17:07

    Rather than using an external ssh program, why not use a Java ssh library:

    • Trilead
    • JTA

    Are two I found with google - that'll avoid the problem that openssh will be working very hard to prevent entering the password on stdin - it'll be opening the terminal directly. expect has to work very hard to simulate a tty in order to work.

提交回复
热议问题