How to Remotely Restart or Shut Down Your Mac

Don't power off a sleeping Mac; use a remote restart instead

To shut down a Mac remotely, you need access to the same local network that the Mac is on. The computer you use to perform the shutdown can be a Mac or a PC. This guide covers the process for Mac computers.

Remotely Access a Mac

There are two ways to remotely access a Mac on your local network. The first is through the Screen Sharing function. The second is through the Remote Login function, which requires the use of Terminal, the Mac command line interface.

Use Screen Sharing to Remotely Shut Down or Restart a Mac

Screen sharing is disabled by default. To remotely shut down a computer using Screen Sharing, enable Screen sharing on the remote computer. You will also need the address or network name of the remote computer.

To enable Screen Sharing on the remote Mac computer:

  1. Open System Preferences. Either go to the Dock and click the System Preferences icon or go to the Apple menu and select System Preferences.

    System Preferences
  2. Select Sharing.

  3. Select the Screen Sharing check box.

    Screen Sharing
  4. Save or write down the network name of the remote Mac. The name is listed at the top of the Sharing preferences pane.

    Sharing network name

On a local Mac computer, follow these instructions to shut down or restart the remote computer:

  1. Open Finder or click on anywhere on the desktop.

  2. From the menu bar, select Go, then choose Connect to Server.

    Connect to server
  3. In the Connect to Server window, enter either the address or the network name of the remote Mac in the format vnc://numeric.address.ofthe.mac. For example, vnc://192.168.1.25

    Alternatively, enter the network name of the remote Mac after the dashes, for example, vnc://MyMacsName.

    Server name
  4. Select Connect.

  5. Depending on how you set up Screen Sharing, you may be asked for a name and password. Enter the appropriate information, then select Connect.

  6. A new window opens that displays the remote Mac's desktop.

  7. Move the mouse cursor into the remote desktop window, go to the menu bar, then select the Apple icon.

  8. Select Shut Down to shut down the target Mac computer or select Restart to restart it.

    Remote shut down

Use Remote Login to Shut Down or Restart a Mac

This feature is disabled by default and must be enabled on the remote Mac before you can control it from another computer.

From the remote Mac:

  1. Launch System Preferences. Either go to the Dock and click System Preferences or go to the Apple menu and select System Preferences.

    System Preferences
  2. Select Sharing.

  3. Select the Remote Login check box to enable remote login.

    Remote login
  4. Next to Allow access for, select Only these users.

    To add more users and groups, select the + icon and choose from the list that appears.

  5. Save or write down the command to access the remote Mac. It is listed above the Users panel and will look like ssh user@IPaddress. For example, ssh george@192.168.1.50.

    Server name

You can now access the remote Mac from a Mac on the same network.

Now from the local Mac:

  1. Open Terminal. Select Applications > Utilities > Terminal.

    Applications > Utilities > Terminal
  2. In Terminal, type the remote login command. This is the command you saved from the Sharing preferences pane on the remote Mac. It should look like ssh user@IPaddress. This gives you login access to the remote Mac.

    Terminal shutdown

    You may need to input your administrator-level password.

  3. To shut down the remote Mac, type sudo shutdown -h now. To restart the remote Mac, type sudo shutdown -r now.

    Instead of now, type +n, with n representing a number in minutes that will elapse before the command is executed. For example, sudo shutdown -r +5 will reboot the remote Mac in five minutes.

  4. If you shut down or reboot the Mac from the SSH command line, you may immediately lose your SSH connection. This behavior is expected. You can re-authenticate as soon as the remote machine has rebooted.