July 9, 2024

How to use the terminal during the Setup Assistant of macOS

How to use the terminal during the Setup Assistant of macOS
In the macOS setup process, there’s a little-known but very useful feature: the ability to open Terminal (and Console) via keyboard shortcuts. This capability can be particularly valuable for system administrators and advanced users who need to perform configurations or diagnostics before the system is fully set up. In this article, we’ll explore how to access Terminal and Console from the Setup Assistant of macOS and some of the useful things you can do with this tool.
ejemplo applivery console

Access to terminal and console in the Setup Assistant

To open Terminal or Console while you’re in the Setup Assistant of macOS, simply use the following keyboard shortcuts:

  • Terminal: CTL + OPTION + CMD + T
  • Console: CTL + OPTION + CMD + C

When you open Terminal, it runs under the _mbsetupuser account, which is the default user used by the Setup Assistant.

Utilities of terminal in the Setup Assistant

Once Terminal is open, you can perform any action that doesn’t require elevated privileges. One of the most common utilities is obtaining the machine’s IP address while in the Setup Assistant using commands like ifconfig or networksetup. networksetup.

Elevate permissions in terminal

Because Terminal runs as _mbsetupuser, actions requiring root permissions cannot be performed. However, if you enable the root user before starting the Setup Assistant, you can elevate your permissions and perform more advanced actions.

Enable Root on an unconfigured machine

To enable the root user on a machine that hasn’t yet gone through the Setup Assistant, follow these steps:
  1. Start your machine in single-user mode.
  2. Mount the startup drive as read/write: /sbin/mount -uw / /sbin/mount -uw /
  3. Enable OpenDirectory: launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
  4. Set the root password: passwd root passwd root
  5. Restart the machine: reboot
Once restarted, while you’re in the Setup Assistant, you can open Terminal and switch from _mbsetupuser to root using the su command. su.
Ejemplo de Applivery

Updating to beta versions of macOS

Once the root user is enabled, you can do interesting things like updating an unconfigured machine to a beta version of macOS. This is useful for testing new features or changes in the Device Enrollment Program (DEP).

Enable Root on an unconfigured machine

  1. Open Terminal in the Setup Assistant.
  2. Elevate to root: su su
  3. Enroll in the public beta: /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll PublicSeed
  4. Install all updates: softwareupdate -i -a
  5. Restart the machine: reboot

Using console

In addition to Terminal, you can also launch Console from the Setup Assistant. Console is useful for monitoring logs and performing diagnostics. For example, you can use it to track the mdmclient process while attempting to enroll the machine via DEP, or to monitor any startup process that occurs before the machine has completed setup.

The ability to access Terminal and Console during the Setup Assistant of macOS opens up a range of possibilities for advanced management and configuration of devices From obtaining network information to enabling the root user for updates or diagnostics, these tools provide additional control that can be invaluable in various situations. Leveraging these features can greatly facilitate the work of system administrators and enhance efficiency in configuring macOS devices.

Share this post

Try Applivery free for 14 days, no credit card required

Join 8.000 companies who already have a head start.

Stay Connected

Explore all posts

— talk to an expert —

Talk to an expert