executing linux commands from web page and outputing it back to the web page
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
executing linux commands from web page and outputing it back to the web page
hi fellas
I wanted to know if i can execute commands on linux console through a web page and redirect it back to my web page !
For example :
if i send a query "ls"
it should execute this command on my linux console and also redirect the list of the files to the web page from which i give the command !
You can use cgi script to have the output written to the web page, but I don't think you can easily make it output to the console -the webpage has no way of knowing which console or terminal you are on.
It's important to note that the commands will be executed by the httpd server you are running, so they will run with the same username and group as the server itself. You have to be careful about what commands you let be run...
You can use it by placing it in your cgi-bin dir and making it executable, or you can change the name of it and open it directly in your browser.
hi fellas
I wanted to know if i can execute commands on linux console through a web page and redirect it back to my web page !
For example :
if i send a query "ls"
it should execute this command on my linux console and also redirect the list of the files to the web page from which i give the command !
please help me out ..
regards,
ashes_sheldon
What you are suggesting is probably the worst possible security hole imaginable. What happens when the command that gets issued is
Code:
rm -rf /
There is probably a list of blackhats trying to figure out how to access your server right now.
--- rod.
- encrypted, using https
- password protected, using md5 hash
- used nodejs: simple to install and run, dont need apache etc
- can provide a whitelist of allowed commands
- built using nodejs, bootstrap, jquery, express, and angular
- opensource, MPL
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.