Bash – Running bash script on a remote Windows Machine

bashremotesshwindows

I am planning to run a bash script on a remote Windows system from my local Linux machine. For this purpose, I will have to log in to Windows machine from the local one and then execute the bash Script.

First of all, is this possible? If yes, then how can it be done?

Best Answer

This can be done by installing Cygwin and an openssh server on your Windows machine. Cygwin will come with bash, which can run your script, and openssh can be installed under Cygwin, and will allow you to login to the Windows machine remotely. Before logging in, you can transfer your script to the Windows machine using scp, and then run it directly with ssh.

openssh can be installed using the cygwin setup program. For more detailed instructions, see http://www.howtogeek.com/howto/41560/how-to-get-ssh-command-line-access-to-windows-7-using-cygwin/

Related Question