I have a bash script on a ubuntu 10.4 machine. It is shared and I can access it from my win7 machine with \\LINUX-SERVER\bash_repo\make-live
However when I do, windows tries to open it. This is not what I want. I want to tell ubuntu to execute it.
I am actually hoping to be able to build a GUI app on windows where the user clicks a button and it tells the bash script on the ubuntu machine to execute.
Is any of this possible?
Have you tried plink from the makers of PuTTY? http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
You should be able to run the script on the ubuntu machine like:
As suggested by my comment above, you can execute your script from PHP if you have a web server running on your ubuntu machine.
A small PHP script like the following will be enough:
Save the PHP code in a file such as
/var/www/exec.php
and point your browser from any machine to the URLhttp://your_ubuntu_machine_ip/exec.php
.Please, note that the script will be executed as
www-data
user (the default apache web server user). If you want to run a privileged command using sudo, you need to addwww-data
user tosudoers
file usingvisudo
.You need an entry like:
As others have suggested you could use ssh to get a CLI session or wrap it in an accessible program, however that you can access it as a network share implies that Samba is configured and running - and there are numerous ways of getting Samba to execute files (e.g. magic script, winpopups, svcctl) rtfm for more details.