Category filter
Script to enable Guest User on Mac
The Guest User feature on macOS provides a convenient and secure way for individuals to use a shared or publicly accessible device without a personal account. Though it allows individuals to access the device without authentication, it ensures that they do not access private data and the digital workspace of an existing user account. In an IT organization, enabling guest accounts on Mac computers provides a secure and temporary access solution, allowing individuals to use the system without compromising sensitive company data contained on the device.
The guest user may access shared folders on a Mac without logging in with a password. They may use apps like Safari but are limited from other functionalities like accessing the encrypted disk or creating files (if FileVault is turned on). Also, the guest user cannot change the user or computer settings. Any files they create are stored in a temporary folder that is deleted upon guest log-out. With Hexnode UEM, you can remotely enable the Guest User option by executing a simple Bash command using the Execute Custom Script action.
Scripting language – Bash
File extension – .sh
Enable Guest User Account
1 |
defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool TRUE |
- The
defaults
command allows you to view and modify the settings used by applications and macOS. - The
write
command is used to write values to property list files. /Library/Preferences/com.apple.loginwindow
is the path to the property list file for login window preferences.GuestEnabled
is the specific preference key being modified here which controls whether the Guest User account is enabled or disabled.- The
GuestEnabled
key in/Library/Preferences/com.apple.loginwindow
accepts a Boolean value. - To turn off the Guest User option, replace
TRUE
withFALSE
.
What happens at the device end?
The status under Guest User will change from ‘Off’ to ‘Login only’ in the Users & Groups preferences after the script is executed. To switch to the login screen, click on the Apple icon and select ‘Logout’ from the menu. Once logged out, you’ll see options to log in with your user account and as a Guest User. Select the Guest User option to access the Mac as a guest.