Reboot Linux System Command

by Vivek Gite on April 11, 2008 · 9 comments

Q. How do I reboot my Linux system? How do I reboot remote Linux system?

A. Linux comes with various utilities that allow a system administrator to reboot, halt or poweroff the system.

Reboot Linux command

You must login as root to reboot the system. Open the terminal and type any one of the following command to reboot the system (following is immediate reboot):
# /sbin/reboot
OR
# /sbin/shutdown -r now
You can also use sudo command under Ubuntu Linux:
$ sudo reboot
It is a good idea to provide notification to all logged-in usersthat the system is going down and, within the last five minutes of TIME, new logins are prevented. Type the following command:
# shutdown -r +5
Sample output:

Broadcast message from vivek@cluster.orarac1.nixcraft.com
        (/dev/pts/1) at 13:21 ...
The system is going down for reboot in 5 minutes!

TIME may have different formats, the most common is simply the word now which will bring the system down immediately. Other valid formats are +m, where m is the number of minutes to wait until shutting down and hh:mm which specifies the time on the 24hr clock.

How do I reboot remote Linux server?

Simply login as the root user using ssh command:
$ ssh root@remote-server.com /sbin/reboot

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 9 comments… read them below or add one }

1 Matey November 27, 2008

Now the trouble is that my server is 90 miles away and does NOT respond to ssh (frozen) How can anyone reboot that sucker without traveling 180 miles (round trip)?
It’s deep buried in some corporates server room too!
I know it is doable but I like to know how!

Reply

2 Josh February 17, 2009

@Matey: You call someone there and ask them to reboot it. Or you install a smart PDU on your remote UPS and power cycle the outlet the server is plugged into.

Reply

3 nichole June 6, 2009

I have a VPS with no panel and I want to reboot my container, will this work as well, or will affect the entire node?

Reply

4 kashyap June 24, 2009

can a normal user reboot a server (assuming he knows the password)
ssh user@xyz.net sudo reboot

does this work ( sorry to ask this but cant test it right now soo….)

Reply

5 wpns November 23, 2009

OK, I’ve got the following working for remotely rebooting a Linux (Centos, but should work elsewhere) system from an OSX machine (using Terminal).

ssh -t username@host.domain.com /usr/bin/sudo /sbin/reboot

If:
/etc/sudoers has:

username 192.168.1.80=/sbin/reboot
username 192.168.1.80=/usr/bin/sudo

at the end. You are supposed to be able to make

username localhost=/sbin/reboot

work, but I had to put the IP address in.

REMEMBER to use visudo to edit the file, i to insert, to stop inserting, :write and then :quit to write and exit.

Enjoy!

Reply

6 supi007 March 18, 2010

Hello,

I have restarted my server remotely but now I cannot reach it. I try it on SSH but nothing. What could happen? I had given out the reboot command. Normally it only do a normal restarting. This is strange. Does anybody any idea?

supi007

Reply

7 wpns March 18, 2010

supi007,

If you gave someone the reboot command they could easily transform it into the shutdown command, so it’s possible your machine has been powered off instead of rebooted. Gotta get someone to push the power button.

Reply

8 supi007 March 21, 2010

wpns,

thank you for reply. I have got two NIC in my server in bond. The bond usually make the life easier but not for me :( When I had restarted my machine, something had gone wrong with the bond connection. I know because when I arrived home I coldnt get IP from my server therefore I had to check it directly on my server. After that I did an ifconfig eth0 down;ifconfig eth0 up and everything was fine again.
Unfortunately it is not a solution in a major case when you far away 100 miles, but it was a good lesson for me. I’m going to remove the second NIC from my server…

supi007

Reply

9 atasözleri April 26, 2010

Thanks you, i am must the this code.

Working nice.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 8 + 8 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the simple math so we know that you are a human and not a script.




Previous post:

Next post: