Reputation: 43
What do I have:
What do I need:
Example:
whatever.cmd:
@echo off
client.exe -ip 192.168.1.1 -port 22 -username notroot -password mypwd -exec remote.sh >192.168.1.1_media.txt
Alternatively, if I convert the sh script to a set of commands sepated by ; symbol, the example may look like this:
@echo off
client.exe -ip 192.168.1.1 -port 22 -username notroot -password mypwd -command 'head `ps -aux`;df -h | grep media' >192.168.1.1_media.txt
Is there an SSH client that can be run in this way? If not, how can I make Putty do the job without using GUI?
Upvotes: 0
Views: 809
Reputation: 2332
Maybe plink
is something for you. It is like putty
but instead of keyboard and screen as input and output you can use pipes for input and output.
This way you can echo the lines of your script to the server.
Plink is downloadable at the putty site: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
There is also an extensive and detailed manual on that site.
Upvotes: 2