Seemingly simple question, which yields slightly undesired results.
\r\nExecute putty to start a script on a remote linux server which requires user input
\r\nThe remote script does a read -p "Please enter name" NAME
I can use plink
to execute a script over SSH, the following attempts and problems are shown below :- Note the -load ns
is to load a session that doesnt exist, ie ensure no defaults are used
1) plink.exe -load ns <ip_addr> -l <user> -pw <password> <script path/name>
Problem) Doesn't allow/show user input, ie its non-interactive.
2) Add -t
to allocate a pty :-plink.exe -t -load nc <ip_addr> -l <user> -pw <password> <script path/name>
Problem) Ok, so now the user input can be seen, but I get Ctrl+H (^H) when backspace is pressed, ok if the user doesnt make a mistake!
3) Use putty instead with a saved sessionputty.exe -load "SavedSession"
Problem) (a) Get a new window opened, not a biggy, but not as nice. (b) saved session cannot be easily moved. (c) Get password prompt, cannot provide password like with plink, I know I know, use keys, but this is a closed, private network, and its easier not to bother with keys!
So ideally, I would like the SSH to execute in-line, that is from within the batch file/command line shell I am in, not prompt for username/password, run the linux script and allow prompts and delete/backspace to work.
\r\nMany thanks for any ideas/solutions in advance.
\r\n=========
\r\nThis will generally be a version we think is reasonably likely to work well. If you have a problem with the release version, it might be worth trying out the latest development snapshot (below) to see if we've already fixed the bug, before reporting it.
\r\n