-   Linux - Desktop (
-   -   How do I execute a bash script from a link on a web page? Is there any way to do this (

digilifellc 03-10-2010 10:37 AM

How do I execute a bash script from a link on a web page? Is there any way to do this
I want to be able to have a Linux computer go to a web page that I have hosted in cyberspace (nexcess) and by clicking a link, I want it to do one of the following:

1. open gnome-terminal and execute the script located on my server to be run locally (my preferred method)
2. download the script, make it executable, and execute the script locally within gnome-terminal

A hybrid of both techniques is acceptable, but I want the solution to be ultimately a one-button solution. In short, if there is a way to click a http link to open gnome-terminal locally and execute a script, then I can ultimately find a way to do what I really would like to do. Thanks in advance.

smoker 03-10-2010 10:45 AM

You don't really want to do that.

If your browser executed scripts from the web then all hell could break loose.

You would need your web server set up to deliver the script in some other form than text.
Then you would have to set your browser to open the script file using a terminal and somehow make it executable on your machine.

That's why we have permissions. To stop things like that happening.

There is no one button solution, the client has ultimate control.

You can use rpms that way, but it's still a bad idea.

digilifellc 03-10-2010 11:12 AM

The reason why I would like to do this is that I have a growing user base that is new to Linux. I want to soften the learning curve with them so that they can fix common issues quickly and painlessly (such as installing java or flash or adobe acrobat quickly). Still a bad idea?

digilifellc 03-10-2010 11:16 AM

Maybe a better solution is how could I set up a ready ssh link that I would be able to connect to a client's computer remotely to administer their system without a lot of to-do in setting such a service up? i.e. a one-button solution that will grant ssh access to me from the client's computer? Possibly using as a simple host portal?

smoker 03-10-2010 11:22 AM

The problem comes when a malicious person sets up a similar thing and the unsuspecting newbie runs it on their computer.

If you want that kind of thing, then stick to windows. But even windows warns you about running untrusted executables.

You have to trust the person you are getting the script from, and you have to understand what the script is going to do.

You can't soften the learning curve without making the users vulnerable.

The best thing to do, is offer the script as it is, explain to them what it does and how to run it, and leave it at that.

Then it's their choice. And make sure you explain that it's their choice and responsibility.

Besides which, your script is going to be quite complicated to take into account all the variables there are between different computers, even if they are running the same distribution. What if it breaks something ?

smoker 03-10-2010 11:24 AM

If you want remote control then look into RDP. But you still should steer clear of "one click" solutions.

All times are GMT -5. The time now is 01:44 PM.