[SOLVED] Remotely Reboot Linux Box From a Windows PC.
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.
We have a Linux Computer at work that occasionally has some problems and needs to be rebooted. But the problem is that the manager of that Dept isn't the most technical person in the world and would like to make this as painless as possible for her.
She is running Windows XP Pro. If it were a Linux machine she was running I would probably just write a little simple Expect script that would ssh to the server and send the "shutdown -r now" command and that would be it. But how would I go about doing that on a windows machine. Is there a way to write an Expect script and make it executable in windows? So all she would have to do is "Click the icon" and that's it?
At first, wouldn't it be better to fix the issues then to reboot the server to fix the symptoms?
To your problem, just use a command line client for SSH in Windows that can do key based authorization and allow her account to reboot the machine using sudo. This way you can write a simple batch script she can click on.
At first, wouldn't it be better to fix the issues then to reboot the server to fix the symptoms?
To your problem, just use a command line client for SSH in Windows that can do key based authorization and allow her account to reboot the machine using sudo. This way you can write a simple batch script she can click on.
Well I think the problem is usually another server that that server connects to. Somehow their connection gets interrupted and the easiest way to fix it is to just do a simple reboot.
It's funny you should post that link, because I came across that very same one. But I wanted to see if anyone had other ideas, never used Putty before. (There's more than one way to skin a cat lol)...
Do you know to use ExtraPutty to send commands from I guess another text like file with a separate command on each line?
It's funny you should post that link, because I came across that very same one. But I wanted to see if anyone had other ideas, never used Putty before. (There's more than one way to skin a cat lol)...
That's true For example, you may write a script on the linux machine that checks for incoming logins in a cycle and if it detects one, it reboots the pc ) but that's probably a stupid idea ))
Quote:
Originally Posted by mrm5102
Do you know to use ExtraPutty to send commands from I guess another text like file with a separate command on each line?
well i never actually tried it, but i guess if you want to run multiple commands, you can put them in a script on the linux machine and run it with a single command via ExtraPutty
That's true For example, you may write a script on the linux machine that checks for incoming logins in a cycle and if it detects one, it reboots the pc ) but that's probably a stupid idea ))
Actually that doesn't sound too bad. I could do something like just create a user on the Linux box ONLY for this one purpose. And like you said, if it gets a login attempt from that one and only user, then it will run a script or something. I like it... That would basically bypass any need to have to run any kind of script from Windows, and the person who is going to use it already knows how to login. So that's a plus plus...
Thanks for the suggestion, I'll give it a try when I get back to work tomorrow and let you know how it goes.
It's axiomatic that a Linux box (and a Windows box, for that matter...) ought not need to be "rebooted." Tools exist ... Nagios, and others ... which can monitor the network connection and automatically restart it.
But, even so, the problem needs to be diagnosed and repaired. (Look at the system log files on both of the machines in question.) Network connections should not "go down unexpectedly." Maybe there's a timeout or something.
When and if things like this do happen, the computer should be perfectly capable of issuing the necessary corrective action with no human intervention required.
I have quite routinely encountered Linux systems (and Windows systems, for that matter ...) which have 'up times' of more than a year. They are never "rebooted," and they never need to be.
Last edited by sundialsvcs; 08-23-2011 at 08:32 AM.
It's axiomatic that a Linux box (and a Windows box, for that matter...) ought not need to be "rebooted." Tools exist ... the one mentioned, or Nagios, and others ... which can monitor the network connection and automatically restart it.
But, even so, the problem needs to be diagnosed and repaired. (Look at the system log files on both of the machines in question.) Network connections should not "go down unexpectedly." Maybe there's a timeout or something.
When and if things like this do happen, the computer should be perfectly capable of issuing the necessary corrective action with no human intervention required.
I have quite routinely encountered Linux systems (and Windows systems, for that matter ...) which have 'up times' of more than a year. They are never "rebooted," and they never need to be.
Yea your right, that would be the best option. Not sure where to look for the errors though...
Do you know where/what logs I should look at to find the problem? It's basically two computers that somehow get a connection through a flash script.
I dunno if it helps to narrow down what logs to look at but it works like this:
The computer running the flash script connects to the other and pulls out some data and displays it using the flash "video". This program that a coworker wrote contains one flash file (.swf) and one HTML file. To run it you would right-click the HTML file and run it in Firefox. The "video" is then displayed in Firefox somewhat like a slideshow of data.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
one solution i've seen on dd-wrt (though probably a horrible idea on a production server) would be to create a user 'reboot' with permissions to reboot the system, then set it's shell to /sbin/reboot, thus simply logging in with that user triggers a reboot, though unless you can restrict how that account gets accessed that would probably be a last ditch idea
Thanks for everyone's help. And MillGates thanks for the suggestion with a user whose sole purpose would be to restart the computer, got it working and it works perfectly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.