Skip to main content

Hide local macOS admin users

Description

HideUse a FileWave Fileset script to hide local adminsmacOS atadmin accounts from the login window while keeping the Other option available for manual username/password sign-in.

Ingredients

  • FWFileWave Central
  • ProperA plain-text editor (likefor TextWranglerreviewing -the OSscript Xbefore or notepad ++ - Windows)deployment

Directions

  1. Make an empty Fileset with a script that runs at activation.
  2. Use this code as an example of howscript to hide adminseligible local admin accounts at login,login and also show the "other.Other..." option atso authorized admins can still sign in with a username and password. This example uses Apple's loginwindow Hide500Users preference, so test it with the loginway window to still use theyour local admin account.accounts are created before broad deployment.
    #!/bin/sh
    # This script is a Postflight sample
    # benm @ fw
    #hide the just made admin account and enable screen sharing 
    echo "hiding local admins at the login window"
    #enable hidden admins
    sudo defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool YES
    #enable "other..." option at login window
    sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWOTHERUSERS_MANAGED -bool TRUE
    
  3. To show adminsthose accounts at the login window again.again, Send out:deploy:
    sudo defaults write /Library/Preferences/com.apple.loginwindow Hide500Users -bool NO