Putty and Plink command line options


Putty can be used as remote ssh client tool.

However today I learn few tricks on it.

It can be used as command line tool to execute script on remote server.

command prompt > putty.exe -t -ssh -l user -pw passwd -m C:\Users\irfan\Documents\run.txt host 

*Replace user, passwd and host with actuals.

Carate run.txt file in your documents directory and enter few commands in it.

In this case I have C:\Users\irfan\Documents\run.txt with date and  ls commands.

Putty command line options

Above command will open putty application, logged into host based on credentials to execute commands from run.txt file.
But it will not return anything back to command prompt.

So what should be I doing to return the output back to command prompt

command prompt > plink.exe -l user -pw passwd -m C:\Users\irfan\Documents\run.txt host 

*Replace user, passwd and host with actuals.

This command will return the output to your command prompt.

Plink command line options

Enjoy!

About these ads
About

What I do today is important because I am paying a day of my life for it. What I accomplish must be worthwhile because the price is high.

Tagged with: , ,
Posted in Misc, Tech Book, UNIX
One comment on “Putty and Plink command line options
  1. retexas says:

    Is this thread still active?
    command prompt > putty.exe -t -ssh -l user -pw passwd -m C:\Users\irfan\Documents\run.txt host

    Can the run.txt file contain “killall /videoserver/bin/myfile.out

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories
Books I Enjoy
Calendar
November 2012
M T W T F S S
« May   Jan »
 1234
567891011
12131415161718
19202122232425
2627282930  
Blog Stats
  • 35,543 hits
Follow

Get every new post delivered to your Inbox.

Join 47 other followers

%d bloggers like this: