0
votes

I have a scenario where I need to run a shell command to a unix based appliance frequently from windows (linux could be an option). Because it's an appliance, it doesn't have the full breadth of capabilities that, say, Linux would have. I am using PuTTY to do this (I could use SSH from linux as well) which, I assume will work if I do something like "putty.exe -ssh -2 -l username -pw password -m c:remote.cmd hostname", but that only gets the command started. A user has to manually input the password - it cannot be done through command line, and I'm unaware of the capability to grab input from a file.

Is there a way by which I can automate this through the Putty?. By that I mean, I would like to send the input to the command in Putty like I was there, which would thereby be sent it to the appliance, not run a local script.

Thanks all in advance. Your input is greatly appreciated as we all may learn a little something. Victor

1

1 Answers

0
votes

For automation, use Plink (from PuTTY package). It's a console equivalent of PuTTY. So it supports input redirection:

( 
  echo password
  echo some other input if needed
) | plink [email protected] command