≡ Menu

Reboot Linux System Command

How do I reboot my Linux based system? How do I reboot a remote Linux system or server using command line?

Linux comes with various utilities that allow a system administrator to reboot, halt or poweroff the system. One must be root or a member of wheel group in order to run reboot command.

Tutorial details
DifficultyEasy (rss)
Root privilegesYes
RequirementsNone
Estimated completion time1m

Reboot Linux command

You must login as root to reboot the system. Open the terminal application (or login to remote box using ssh client) and type any one of the following command to reboot the system immediately:
# /sbin/reboot
OR
# /sbin/shutdown -r now

You can also use sudo command under Ubuntu/Debian/Fedora and other Linux based distros:
$ sudo reboot

It is a good idea to provide notification to all logged-in users that 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
OR
$ ssh root@remote-server.com /sbin/shutdown -r now

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 16 comments… add one }

  • Matey November 27, 2008, 5:51 pm

    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!

  • Josh February 17, 2009, 6:43 pm

    @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.

  • nichole June 6, 2009, 7:32 am

    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?

  • kashyap June 24, 2009, 4:02 am

    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….)

  • wpns November 23, 2009, 2:35 pm

    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!

  • supi007 March 18, 2010, 9:58 am

    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

  • wpns March 18, 2010, 8:15 pm

    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.

  • supi007 March 21, 2010, 9:24 am

    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

    • Akshay August 27, 2012, 10:29 am

      Hi…
      I need help from U.

      I want to restrt the Redhat server 6.3 server.
      Which is locatedin different country.
      How to do that and is their any risk of doing it?
      If risk any solution for that.

  • atasözleri April 26, 2010, 2:42 pm

    Thanks you, i am must the this code.

    Working nice.

  • Akshay August 27, 2012, 10:24 am

    Hi it means…
    Do we cant restart the server remotely.?

    I want to restart the server which is in different country.
    Can i restart that machine from SSH.
    If so what i shold do. It shold not be risk.
    I have root permision.

    • Eric May 14, 2013, 6:57 pm

      1) login as root (or login and su to root),
      2) type (and hit return):
      /sbin/shutdown -r now

      It should tell you “SYSTEM IS GOING DOWN FOR REBOOT NOW”
      and after 20 seconds or so (during which it is shutting down services) it will reboot.

  • Cisco August 31, 2012, 3:33 pm

    shutdown -r “now” shuts down server
    reboot “now” shuts down server
    cant reboot it. It only shuts down any Ideas

  • dee November 15, 2012, 2:42 am

    After I run the command # /sbin/shutdown -r now, my nagios gives an error below:

    Error: Could not read host and service status information!

    Any ideas?

  • William Smith November 15, 2012, 12:58 pm

    dee,

    Does it still reboot, or does it fail to reboot at all? Google sez that Nagios error is a Nagio configuration issue.

  • dee November 16, 2012, 6:52 am

    Hi William,

    Yes, it can still reboot. The error I have mentioned was on web access in nagios.
    I solved the issue by checking windows.cfg. I found out that there were two items that are typo error.

    Thanks.

Leave a Comment