Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Execute script placed on a remote unix box

 
Mohtashim Shaikh
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, is there way of automating this ?

My ultimate goal is to run some cmd script in windows and it should connect to a remote unix host and run a script x.sh located on the remote unix host.

I was wanting to achieve this by using WinSCP and Putty only. If possible let me know how and if not then what is the minimum number of tools I can use to achieve this and how.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18222
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is actually a fairly common thing to do. I've even got a production system of my own that does this.

Basically, you can use a single "ssh" command that logs in and executes a single command within the context of the logged-in user (in other words, the script already has to be present on the target machine). Then it logs out.

I'm almost totally certain that the PuTTY toolset has a command-line ssh program that will do that for Windows users.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic