trio.so
How-Tos

How to Shut Down a Mac Remotely: A Guide for IT Admins

Shut down or restart a Mac remotely with Terminal and SSH, Screen Sharing or your iPhone, and what to check before you restart a Mac you cannot reach.

Mountain landscape representing leadership perspective and vision
Written by
Atena Ladchartabi

Content writer, trio.so

Published on
Modified on

To shut down a Mac remotely, turn on Remote Login on the Mac, then connect over SSH and run sudo shutdown -h now. Use -r instead of -h to restart. You can also do it from Apple Remote Desktop, from an MDM that sends Apple's shut down command, or from an iPhone with an SSH app. Before you restart a Mac you cannot reach, check whether FileVault is on: after a restart it waits at a password screen where no remote tool runs.

This guide covers each method, scheduling shutdowns, the security settings that keep remote power commands safe, and how to handle a whole fleet.

Using SSH to Shut Down a Mac Remotely

Secure Shell (SSH) lets you open the Mac's command line from another computer and run the shutdown command without touching the device.

How to Enable SSH on a Mac

Turn on Remote Login on the Mac you want to control:

  1. Open System Settings > General > Sharing.
  2. Turn on Remote Login.
  3. Click the info button next to it and allow only the administrator accounts that need access.

You can then connect from another Mac, a Linux machine, or Windows (which includes an OpenSSH client in recent versions).

Executing Remote Shutdown via SSH

From your own computer, run:

ssh -t [email protected] 'sudo shutdown -h now'
  • Replace admin with an administrator account on that Mac.
  • Replace the address with the Mac's IP address or its .local name.
  • -t gives the session a terminal, so sudo can ask for the password.

To shut down later instead of now, give the number of minutes:

sudo shutdown -h +30

That shuts the Mac down in 30 minutes. Cancel a pending shutdown with sudo killall shutdown.

SSH needs the Mac to be reachable on the network and an account with administrator rights. A firewall between you and the Mac can block it.

Restart a Mac remotely with Terminal

The same command restarts the Mac when you use -r:

ssh -t [email protected] 'sudo shutdown -r now'

Use sudo shutdown -r +5 to give the user five minutes to save their work.

Shutting Down Macs with Apple Remote Desktop (ARD)

Apple Remote Desktop is Apple's app for administrators who manage several Macs. It can shut down, restart and send commands to many Macs at once from a window.

How to Connect Remote Desktop in Mac

  1. Install Apple Remote Desktop from the Mac App Store on the admin Mac.
  2. On each target Mac, turn on Remote Management in System Settings > General > Sharing.
  3. Add the Macs to Apple Remote Desktop by name or IP address.

Executing Shutdown Commands in ARD

  1. Open Apple Remote Desktop.
  2. Select the Macs you want to shut down.
  3. Choose Manage > Shut Down, or send a UNIX command such as shutdown -h now as root.

Apple Remote Desktop suits schools and offices where the Macs share a network. It is a paid app and only reaches Macs it can see on the network, so remote staff need a VPN.

Leveraging MDM Solutions for Enterprise-Wide Shutdowns

A mobile device management (MDM) server talks to enrolled Macs through Apple's management protocol, which includes commands to shut down and restart a Mac. The Mac carries out the command the next time it checks in, wherever it is.

Why Use MDM for Remote Shutdowns?

  • It works over the internet, without a VPN or open SSH port.
  • One admin can reach one Mac or a group.
  • The console records who sent which command, which helps after an incident.

How to Shut Down Macs Using MDM

The steps differ between products, but the pattern is the same:

  1. Sign in to the MDM console.
  2. Select the Mac or group.
  3. Send the shut down or restart command, or run a script that does it.
  4. Check the command's status until the console shows it completed.

The Mac must be enrolled and online for the command to arrive. For how company Macs get enrolled in the first place, see Apple device enrollment. For more on remote options, see remote access for Mac and device managers for Mac.

Shut down a Mac from your iPhone

Apple has no built-in button for this. Two ways work:

  • An SSH app on the iPhone. Connect to the Mac with an SSH client from the App Store and run sudo shutdown -h now, as above. Remote Login must be on, and the iPhone must reach the Mac, either on the same Wi-Fi or over a VPN.
  • A Shortcuts action. The Shortcuts app has a Run script over SSH action. Add the Mac's address, the account and the shutdown command, then run the shortcut from your Home Screen or Siri.

A remote access app that shows the Mac's screen also works: you click Shut Down in the Apple menu as you would at the desk.

Schedule a shutdown or restart

For a nightly shutdown, use pmset instead of sending a command every evening:

# every weekday at 10 pm
sudo pmset repeat shutdown MTWRF 22:00:00

# one time
sudo pmset schedule shutdown "10/30/26 22:00:00"

# check and clear
pmset -g sched
sudo pmset repeat cancel

An app with unsaved work can ask the user to save before it quits, which can hold up the shutdown. Tell users the schedule so they save and quit first.

Can you turn a Mac back on remotely?

Not after a full shutdown, in most cases. A Mac that is asleep can wake for network access if Wake for network access is on in its energy or battery settings, so a Wake-on-LAN packet or a connection attempt can wake it. A Mac that is shut down needs someone to press the power button, unless your model supports a scheduled power on with pmset repeat wakeorpoweron. Restart instead of shutting down when you need the Mac back.

FileVault Macs after a restart

A Mac with FileVault on stops at the FileVault login screen after a restart, before macOS starts. SSH, Screen Sharing and remote management agents are not running there, so you lose remote access until someone signs in at the Mac.

For a one-time restart you control, use an authenticated restart, which unlocks the disk for the next startup only:

sudo fdesetup authrestart

It asks for a FileVault user's password or the recovery key. Plan other restarts for when the user is at the Mac. For more on FileVault, see should I use FileVault.

Security Considerations for Remote Shutdowns

Anyone who can shut down your Macs remotely can also disrupt your business. Keep that power with a small, named group:

  • Allow Remote Login only for admin accounts, use SSH keys instead of passwords, and limit connections to your admin network or VPN.
  • Require multi-factor authentication for your MDM console and for the VPN.
  • Give remote power commands only to the roles that need them.
  • Keep logs of who sent which command, and review them.

Warn users before a mass shutdown so nobody loses unsaved work.

IT admin using Mac

Best Practices for Managing Remote Shutdowns in an IT Environment

1. Establish Clear Shutdown Policies

Write down when and why Macs are shut down remotely: nightly power saving, security incidents or maintenance windows.

2. Use Scheduled Shutdowns Where Possible

A pmset schedule or an MDM schedule is more reliable than someone remembering to send a command.

3. Maintain Network Connectivity for Remote Commands

A Mac must be awake and online to receive a command. Use Wake for network access where you need it.

4. Perform Tests Before Executing Mass Shutdowns

Try the command on two or three Macs first, including a FileVault Mac, before you send it to the fleet.

5. Train IT Staff on Secure Remote Management

Make sure the team knows the remote access methods in use and what to do if a shutdown command arrives that nobody sent.

Managing this across many devices

SSH reaches one Mac at a time and only on a network you can route to. trio.so runs scripts and opens a live terminal on enrolled Macs from the console, so one restart script can go to the Macs you pick. See remote terminal.

The trio.so Create script wizard with a bash script that restarts a Mac in one minute with shutdown -r.
In trio.so, IT writes one restart script and runs it on enrolled Macs from the console.

Conclusion

SSH is the quickest way to shut down or restart one Mac you can reach. Apple Remote Desktop handles several Macs on the same network. An MDM reaches enrolled Macs anywhere. Whichever you use, test on a few Macs first, plan around FileVault restarts, and keep remote power commands with a small group of admins.

Related reading: macOS screen sharing, remote access for Mac and RMM solutions.

Ready-to-use Templates

Must-have Template Toolkit for IT Admins

Explore All
Template Toolkit

Send commands to every Mac from one console

Skip the SSH sessions. trio.so sends commands to managed Macs from one dashboard and shows the result for each device. Try it free for 14 days.

Start free trial

Manage Every Device From One Console

trio.so brings device management, patching and security policies for Windows, macOS, Linux, iOS/iPadOS and Android into one console. Enroll a device and see it in the console within minutes.

14-day free trial. No credit card required.

trio.so brings device management, patching and security policies for Windows, macOS, Linux, iOS/iPadOS and Android into one console. Enroll a device and see it in the console within minutes.

Smiling womanAbstract geometric patternAbstract geometric patternSmiling womanSmiling woman

Frequently Asked Questions (FAQ)

Have questions? We've got answers. This section covers some of the most commonly asked questions related to this topic.

Yes. Turn on Remote Login, then run ssh -t user@mac-address 'sudo shutdown -h now' from another computer. Apple Remote Desktop and MDM tools can do it too.

Use an SSH app or the Shortcuts action Run script over SSH to send sudo shutdown -h now to the Mac. The iPhone must be able to reach the Mac on the network.

Run sudo shutdown -r now over SSH, or sudo shutdown -r +5 to restart in five minutes.

Not from a full shutdown on most Macs. A sleeping Mac can wake for network access if that setting is on, so restart instead of shutting down when you need it back.

Related

From the blog

The related industry news, interviews, technologies, and resources.