0

I need to login to an SSH session using password, and then execute the user input values for a particular account.

For example:

PLINK.EXE -ssh ***** -l ***** -pw *****

I am able to login, now what I need to do is enter below values:

  • Please select account to logon: "U"
  • Press RETURN to continue or OFF to cancel session - "RETURN"

There are similarly this kind of user inputs needed. Is there a way I store the "*" values in a text file and load them using Plink.

I tried:

PLINK.EXE -ssh ***** -l ***** -pw ***** -m C:\input.txt

This does not seems to be working.

Expectation: Passing all the user input i.e. "U", "RETURN" .... using Plink or any other PuTTY tool.

Appreciate your help!

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Raj Shiva
  • 11
  • 1
  • 1

1 Answers1

1

The -m switch is used to execute commands in shell. You cannot use it to provide inputs for the executed commands.

But as Plink is a console application, you can use an input redirection to provide input:

plink.exe -ssh ... -l ... -pw ... < C:\input.txt
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992