There are a bunch of customizations you can do to the standard macOS Login Window. All of them work on macOS 10.14 Mojave. All of them I didn’t know about until I did. Now it is your turn. See how many you already know and tweet the results to @tperfitt for honor and glory.
1. Switch between picture and user/password mode
Press Option-Return (⌥-Return) to switch between user icons and username & password.
2. Secret Commands
Instead of entering in a username, there are some secret commands that can be entered (all of them start with “>”):
Shut down the Mac:
>power
Restart the Mac:
>restart
Shut down the Mac:
>shutdown
Sleep the Mac:
>sleep
Restart the Login Window:
>exit
3. Hostinfo
You can enable a secret status menu item that shows computer info. Example values include: “HostName”, “SystemVersion”, “SystemBuild”, “SerialNumber”, “IPAddress”, “DSStatus”, and “Time”. To enable, run the command below in Terminal, with the last option being the one that you want displayed first. Then click on the clock in the login window.
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo IPAddress
4. Log in with a PIN instead of a password
macOS has support for smart cards, and the YubiKey can be set up as a smart card. If you insert a configured Yubikey, you can pair the Yubikey authentication to the user account. The next time you log in, you use a PIN rather than a password.
5. Show Login Window with Full Disk Encryption
If you enabled Full Disk Encryption (File Vault), you enter your password at first startup to unlock the disk and you never see the Login Window. To have your Mac show the Login Window instead of automatically logging in, enter this command in Terminal:
sudo defaults write /Library/Preferences/com.apple.loginwindow DisableFDEAutologin -bool YES
7. Hide the Buttons
The Shutdown/Restart/Sleep buttons can be hidden. Head over to System Preferences -> Users & Groups and click Login Options. You can turn off the buttons right there (after clicking the lock to authenticate, of course!).
If you want to turn some of the buttons off but leave some on, select the appropriate command to turn them off:
sudo defaults write /Library/Preferences/com.apple.loginwindow ShutDownDisabled -bool true
sudo defaults write /Library/Preferences/com.apple.loginwindow RestartDisabled -bool true
sudo defaults write /Library/Preferences/com.apple.loginwindow SleepDisabled -bool true
and to turn them back on:
sudo defaults write /Library/Preferences/com.apple.loginwindow ShutDownDisabled -bool false
sudo defaults write /Library/Preferences/com.apple.loginwindow RestartDisabled -bool false
sudo defaults write /Library/Preferences/com.apple.loginwindow SleepDisabled -bool false
8. Login Window Text
You can add in some text to appear on the Login Window using a defaults command in Terminal:
sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText -string 'This computer belongs to Timothy Perfitt (630 867-5309)'
To remove the message, delete the LoginwindowText key:
sudo defaults delete /Library/Preferences/com.apple.loginwindow LoginwindowText
9. Run a script
You can easily run a script after each login by running a Terminal command and giving a path to the script:
sudo defaults write com.apple.loginwindow LoginHook /path/to/script
I use it to send me a push notification via a Zapier Webhook every time someone logs into my computer. $1 is the short name of the user logging in, and $HOSTNAME is the name of the computer:
#!/bin/sh
curl “https://hooks.zapier.com/hooks/catch/8675/309/?name=$1&computer=$HOSTNAME”
Now, when someone logs into my computer, I get a push notification on iOS:
Advanced note for nitpicky admins: Yes, I know login hooks have been replaced by LaunchAgents which also run at login, but Login Hooks still work in Mojave, so settle down.
10. Turn on/off keyboard navigation
If you press Control-F7 (⌃-F7), or Control-Fn-F7 (⌃-Fn-F7) on portables, tab switches from going to all controls to just username and password.
11. Show keyboard
If your brother accidentally drops a chocolate covered cherry onto your keyboard and all the keys are stuck together*, you can activate an on-screen keyboard to log in with an onscreen keyboard. To turn on the onscreen keyboard, go to System Preferences->Users & Groups and click on Login Options. Select “Accessibility Options…” and turn on the Accessibility Keyboard.
*Not a made up story.
12. Usage Policy
macOS has a simple way to put up a usage policy that requires you to click Accept prior to logging in. It allows you to customize it with graphics and text and setting it up is simple:
- Open TextEdit and add text and graphics to a document.
- Resize the TextEdit window to be the size you want to the usage policy.
- Save the document as PolicyBanner to the Desktop.
- Drag the PolicyBanner to /Library/Security
That’s it! Now, when the Login Window shows, the Usage Policy will show over it. You have to accept prior to being allowed to log in.
There you go! 12 different customizations to the Login Window in macOS 10.14 Mojave (and earlier). If you like these blog posts, follow me on Twitter (@tperfitt) or sign up for our newsletter (I do list of blog posts when the newsletter comes out, which is about every month). Also, check out our software at https://twocanoes.com or head over to the main blog page.