3PAR Users Group

A Storage Administrator Community




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: SSH scripting and Putty
PostPosted: Mon May 05, 2014 10:19 am 

Joined: Thu Apr 17, 2014 2:12 am
Posts: 5
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!


Top
 Profile  
Reply with quote  
 Post subject: Re: SSH scripting and Putty
PostPosted: Wed May 07, 2014 3:01 am 

Joined: Wed May 07, 2014 1:51 am
Posts: 234
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 :?

_________________
When all else fails, read the instructions.


Top
 Profile  
Reply with quote  
 Post subject: Re: SSH scripting and Putty
PostPosted: Wed May 07, 2014 5:49 pm 
Site Admin
User avatar

Joined: Tue Aug 18, 2009 10:35 pm
Posts: 1175
Location: Dallas, Texas
Putty is intended to be an interactive GUI.
plink (part of putty) is the command line version.

Try plink with your -m script.

_________________
Richard Siemers
The views and opinions expressed are my own and do not necessarily reflect those of my employer.


Top
 Profile  
Reply with quote  
 Post subject: Re: SSH scripting and Putty
PostPosted: Fri Jun 13, 2014 5:38 am 

Joined: Sun Jul 29, 2012 9:30 am
Posts: 576
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group | DVGFX2 by: Matt