
Run a command prompt on a remote computer with PsExec, Enter-PSSession and Invoke-Command. Setup, fixes for access denied, and the security risks to watch.
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.


Content writer, trio.so
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.
Secure Shell (SSH) lets you open the Mac's command line from another computer and run the shutdown command without touching the device.
Turn on Remote Login on the Mac you want to control:
You can then connect from another Mac, a Linux machine, or Windows (which includes an OpenSSH client in recent versions).
From your own computer, run:
ssh -t [email protected] 'sudo shutdown -h now'
admin with an administrator account on that Mac..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.
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.
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.
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.
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.
The steps differ between products, but the pattern is the same:
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.
Apple has no built-in button for this. Two ways work:
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 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.
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.
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.
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.
Anyone who can shut down your Macs remotely can also disrupt your business. Keep that power with a small, named group:
Warn users before a mass shutdown so nobody loses unsaved work.
Write down when and why Macs are shut down remotely: nightly power saving, security incidents or maintenance windows.
A pmset schedule or an MDM schedule is more reliable than someone remembering to send a command.
A Mac must be awake and online to receive a command. Use Wake for network access where you need it.
Try the command on two or three Macs first, including a FileVault Mac, before you send it to the fleet.
Make sure the team knows the remote access methods in use and what to do if a shutdown command arrives that nobody sent.
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.

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





Have questions? We've got answers. This section covers some of the most commonly asked questions related to this topic.
ssh -t user@mac-address 'sudo shutdown -h now' from another computer. Apple Remote Desktop and MDM tools can do it too.sudo shutdown -h now to the Mac. The iPhone must be able to reach the Mac on the network.sudo shutdown -r now over SSH, or sudo shutdown -r +5 to restart in five minutes.Related
The related industry news, interviews, technologies, and resources.

Run a command prompt on a remote computer with PsExec, Enter-PSSession and Invoke-Command. Setup, fixes for access denied, and the security risks to watch.

Learn how to remotely uninstall software across multiple devices efficiently. Discover tools and best practices to get the perfect result.

Seven IT monitoring software picks for 2025, what to look for when choosing one, and tips for a smooth rollout.

Discover low-cost remote access software to empower IT admins to efficiently manage & support remote devices, boost productivity, and reduce downtime.

Discover how to secure remote connections with advanced technologies and best practices. Learn about remote access security risks, solutions, and tools.

RMM agents play a pivotal role in providing the tools necessary for organisations to maintain their systems efficiently and securely.

How to get remote access to a Mac: Screen Sharing, Remote Management, SSH and third-party tools, connecting from Windows, and how to keep it secure.

The blog provides a comprehensive guide on remote access for PCs, covering its types, popular tools, setup process, and security best practices.
14-day free trial. No credit card required.
trio.so for MSPs: one console, separate clients