1

I am trying to login into Linux box through JSch code.

Issue: I have a problem that after login into Linux box through PuTTY, it will directly prompt me to select one option 5, then I need to enter a value among 1,2,3,4,5 which then goes to respective directory.

Example: after login into Linux machine it give me five environments:

  1. prod
  2. qa
  3. dev
  4. cert
  5. none so I need to choose among above five.

If I enter 3 then it will change to the dev environment.

Please help me and let me know how to implement this in JSch or related Java code.

c_anirudh
  • 375
  • 1
  • 22
santhosh
  • 11
  • 1

1 Answers1

0

Those are not commands. Those are human inputs.

System that requires an human interaction like this is not designed to be automatable. You should talk to the server administrator to offer better "API".

If that's not possible, you have to simulate the interaction.

For an example, see
Executing multiple commands over SSH "exec" channel on firewall device with Java JSch does not work

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992