LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Remote reboot from another server?? (https://www.linuxquestions.org/questions/linux-server-73/remote-reboot-from-another-server-4175429461/)

davemac2626 09-28-2012 11:05 AM

Remote reboot from another server??
 
Hi all

I was just wondering if there is any way of remotely rebooting a linux server from another? ie: like the shutdown -i command in Windows....

If you cannot SSH onto the problem server can you reboot it via another machine?

Thanks in advance

Dave

273 09-28-2012 11:12 AM

Code:

shutdown -r now
?
Code:

man shutdown
For more options.

davemac2626 09-28-2012 11:21 AM

shutdown -r now is on the actual server im on about shutting down 1 server from another...

for example: shutdown -r now 10.1.1.1 (CLI on 10.1.1.2)

Thanks

273 09-28-2012 11:26 AM

Sorry, for some reason I completely misread your post and though you could SSH onto the server.

You need to connect to some kind of server service running on the machine to restart it though, as you do on a Windows machine.

davemac2626 09-28-2012 11:27 AM

No problem thanks for the quick reply regardless :)

TobiSGD 09-28-2012 11:28 AM

If you want to reboot a server that you can not connect to through the network you have to use a hardware management interface, like IPMI: http://en.wikipedia.org/wiki/Ipmi

davemac2626 09-28-2012 02:49 PM

Thanks for the reply again - so there is no way of doing it with snmpset?? I know that its possible to do this on a cisco switch using the snmpset method as long as write access is granted, plus you can do it with shutdown -i with windows - it then surely is possible on a linux box? i have just been doing some digging and found that if netcat is setup to listen on one server you can create a back-door to take control :D

I will set this up, test and let you know how it goes - unless everyone already knows this!

Many thanks

Dave

273 09-28-2012 03:10 PM

You can use shutdown -i on Windows only when the appropriate service is running (RPC?) and the port is open. I don't recall whether Windows opens the port to the world by default or not but I've certainly come across situations where machines can't be shut down with that command.
For any OS to reboot you have to get a message to the kernel of the OS through a listening server. I'll admit my Linux specific knowledge on this isn't great but I would consider any such service a huge security hole unless, like SSH, it's authenticated.

TobiSGD 09-28-2012 03:59 PM

I thought you are looking for a solution in case the machine has crashed, so that no SSH connection is possible. In that case you need hardware support, like IPMI. If the machine is working correctly, what would be the point in using an insecure netcat hack instead of just running SSH?

davemac2626 09-29-2012 05:33 AM

Thanks for the reply guys....

TobiSGD - it is for a Linux box acting as a B2BUA and the SSH does keep dying so I cannot access the box so wanted a solution of rebooting it as the server is located around 20 miles away in the DC and "remote hands" are not available - its completely internal so the security implications don't really come into it which is why I was thinking of a back-door for future use.

Hope this explains better my reason for the original post :)

TobiSGD 09-29-2012 06:11 AM

So if I get that right: The whole problem is that the SSH server goes down and instead of trouble-shooting that problem, like an admin would normally do, you plan to implement a backdoor?

davemac2626 09-30-2012 02:33 PM

Hang on a min!....firstly I never said I was any sort of admin! If you look at my other posts it explains that I am a noob in Linux. Secondly I thought the whole point of forums like these was to HELP people with ideas! No need to be a tube about it is there?!?!

273 09-30-2012 02:34 PM

Then why don't you ask the admin to keep SSH running or reboot the server for you?

davemac2626 09-30-2012 02:58 PM

There is no admin! otherwise trust me I would! there is noone with extensive Linux experience I'm a noob and i'm probably the most clued up on Linux! only cos of the previous help on here which is why I decided to post another question! along with reading, research and questions thats how you get to know things, which is what i was trying to achieve!

273 09-30-2012 03:08 PM

Then I think TobiSGD may have a point. Opening a back door in a server to get around a failing daemon isn't a great idea so the real answer is probably to troubleshoot SSH.
Otherwise you're possibly looking at buying a network card with built in console or similar anyhow. Do you know whether the server has such a facility?


All times are GMT -5. The time now is 01:26 AM.