LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-28-2006, 09:08 AM   #1
milescook
Member
 
Registered: Jun 2003
Posts: 54

Rep: Reputation: 15
How toExecute bash scripts from web interface


I have a script on my machine, in a user's directory. I run it using "sh script option" and it works beautifully. However, so my client doesn't have to download putty and log in to the server, I'd like him to just log in to a web page, and press a button, that executes the script....

How?

Cheers
 
Old 05-28-2006, 09:34 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
You can run a Bash script as CGI. You need to go over input validation real good before you put this in production because any user must not be able to abuse (escape) any args to get access, run system commands, more info, you get the idea.


so my client doesn't have to download putty and log in to the server
This actually is *not* a bad alternative. With OpenSSH you can for instance fix a key to be able to only run one command.
 
Old 05-28-2006, 09:36 AM   #3
milescook
Member
 
Registered: Jun 2003
Posts: 54

Original Poster
Rep: Reputation: 15
ok thanks. So what's the best way forward then?
 
Old 05-28-2006, 09:44 AM   #4
vls
Member
 
Registered: Jan 2005
Location: The grassy knoll
Distribution: Slackware,Debian
Posts: 192

Rep: Reputation: 31
1. Use Apache's Server Side Includes.

Intro Article

2. PHP has a number of functions for executing shell comands

Execution Functions
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
little help with bash scripts sniff Programming 2 10-26-2005 06:17 PM
bash scripts hoffmanyew Programming 3 08-11-2005 02:27 AM
Need Help With Bash Scripts the_woelf Linux - Software 4 06-30-2004 10:09 AM
Bash Scripts Skute Programming 7 03-12-2004 11:17 AM
Bash scripts? BajaNick Programming 3 07-05-2003 11:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration