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.
I want to make a html page which have a submit button , anyone who are accessing my page over the network and hit the submit button his system going to reboot.
I have code a html page which has action="reboot.php" which upon submitting it ran the reboot.php script...in reboot.php i have the code as follows
<?php
exec("sudo /sbin/shutdown");
?>
but it dosent work for me??? please help how to design such page
PHP is executed on the server. The client only receives the text output by the script. Also, your web server probably runs under a username that doesn't have sudo privileges.
Kevin Barry
PHP is executed on the server. The client only receives the text output by the script. Also, your web server probably runs under a username that doesn't have sudo privileges.
Kevin Barry
so how do i make a page that will shudown my clients pc,whenever they press the submit button of my page.....please help
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
well, you COULD edit the sudoer's file to allow the 'user' the web server runs as sudo privileges to reboot the machine without a password, but this is horrible in practice because it opens a serious security hole in your system.
you probably would be better off installing Webmin on the system in question, which provides not only a means of rebooting the server, but also of managing the server remotely, AND it provides an authentication mechanism, and can be run via SSL.
There's a reason it's not an easy thing to do. A button that could shut down one's computer via a web page wouldn't have to be labeled "CAUTION! THIS WILL SHUT DOWN YOUR COMPUTER!" It could literally say anything. What if my computer shut down when I pressed "Post Quick Reply" on this page? If anyone with a web page could arbitrarily shut down my machine I wouldn't ever use the web. You should probably just post a statement that says, "Please shut down your computer if it's an appropriate time to do so."
Kevin Barry
well, you COULD edit the sudoer's file to allow the 'user' the web server runs as sudo privileges to reboot the machine without a password, but this is horrible in practice because it opens a serious security hole in your system.
you probably would be better off installing Webmin on the system in question, which provides not only a means of rebooting the server, but also of managing the server remotely, AND it provides an authentication mechanism, and can be run via SSL.
I think OP is asking for "frieza goes to my web page and clicks a button, then frieza's machine shuts down and I laugh."
Kevin Barry
There's a reason it's not an easy thing to do. A button that could shut down one's computer via a web page wouldn't have to be labeled "CAUTION! THIS WILL SHUT DOWN YOUR COMPUTER!" It could literally say anything. What if my computer shut down when I pressed "Post Quick Reply" on this page? If anyone with a web page could arbitrarily shut down my machine I wouldn't ever use the web. You should probably just post a statement that says, "Please shut down your computer if it's an appropriate time to do so."
Kevin Barry
yes you are right,but tell me is there any way to do so,and what is webmin,please tell me if there is any other way other than webmin to do so?
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
webmin is a program that allows remote management/adminsitration of a Linux/*NIX machine (creation/deletion of user accounts, file shares, configuration of server processes, administration of the bootup/shutdown process, software updates, cron jobs, etc...), via a convenient web based interface.
note however the interface affects the REMOTE machine running webmin, not the local machine running the browser.
you can also reboot or shutdown the machine remotely via the webmin interface.
yes there are probably other softwares that do this, but webmin is the only one i can think of at the moment.
webmin is a program that allows remote management/adminsitration of a Linux/*NIX machine (creation/deletion of user accounts, file shares, configuration of server processes, administration of the bootup/shutdown process, software updates, cron jobs, etc...), via a convenient web based interface.
note however the interface affects the REMOTE machine running webmin, not the local machine running the browser.
you can also reboot or shutdown the machine remotely via the webmin interface.
yes there are probably other softwares that do this, but webmin is the only one i can think of at the moment.
i am using red hat enterprise linux 6,is webmin available for free,if yes tell me the link please.
magicalshashank31, this thread is pointless and borderline malicious. While I don't think you'll be successful at accomplishing your goal of shutting down the machine of your helpless visitors, you'll have to continue looking for someone to help you with this task somewhere else besides 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.