Page 1 of 1

SSH scripting and Putty

Posted: Mon May 05, 2014 10:19 am
by Mikko
Good day,
I am very new to scripting but interested in learning more.
I have to do my 3par scripting with putty via SSH. I created the public/private keys but when I execute putty from command line and give an external file (my script) as an argument it just says "unprintable characters in command". The script works fine if I execute it interactively. Is this a putty- related issue or something else? '
Also, is it possible to execute multiple commands from one external file? What is the best practice using SSH?
Thank you very much for your help!

Re: SSH scripting and Putty

Posted: Wed May 07, 2014 3:01 am
by apol
Hi,

when you use kitty (beefed up putty) instead of plain putty, there is a "send script file" option in the menu. But this way isn't that good for real scripting, it just dumps the whole file as is. This can be a problem with commands that start a task (which you have to wait for before going on), or if you put some logic in your scripts. Error handling, loops, etc.

I prefer the ssh-cli for interactive working, but use a local installed cli for scripting.

But to be honest, I'm not a very savvy user of putty or kitty, so there might of course be a way to do better than I do :?

Re: SSH scripting and Putty

Posted: Wed May 07, 2014 5:49 pm
by Richard Siemers
Putty is intended to be an interactive GUI.
plink (part of putty) is the command line version.

Try plink with your -m script.

Re: SSH scripting and Putty

Posted: Fri Jun 13, 2014 5:38 am
by hdtvguy
Any reason why you have to do it via SSH and not via the CLI? The CLI is extremely powerful and has numerous features to make life easy for scripting.