Add a Login Message to OS X Using Terminal or System Preferences

Add a Message or Greeting to Your Mac's Login Window

Security & Privacy preference pane being used to add a login message.
It's not a well-kept secret, yet few Mac users seem to know that they can alter the default OS X login window to include a message or greeting. Screen shot courtesy of Coyote Moon, Inc.

It's not a well-kept secret, yet few Mac users seem to know that they can alter the default OS X login window to include a message or greeting. The message can be for just about any purpose. It can be a simple greeting, such as "Welcome back, buddy" or a silly one, such as "While you were away, I cleaned up all those messy files on your drive. You're welcome."

Other uses for a login message are to help identify the Mac or the OS that it's running, which can be very helpful in a school or computer lab setting.

In such environments, computers get moved about quite a bit, so knowing which Mac you're sitting in front of, and which OS it's running, can save you a good deal of time. In this case, the login message could be something like "I'm Sylvester, and I'm running OS X El Capitan."

There are three ways to set the login window message: using OS X Server, with Terminal, or by using the Security & Privacy system preference pane. We'll look at all three methods, and provide detailed instructions for the last two methods.

Login Message with OS X Server

The login window message has always been customizable, but for the most part, only those who were running OS X Server and managing a bunch of Mac clients ever bothered to set up the optional login message. With the server OS, it's a simple matter of just using the Workgroup Manager tool to set the login message. Once set, the message is propagated to all of the Macs that connect to the server.

Setting the Login Message for Individual Macs

Luckily, you don’t actually need OS X Server to add a custom login message to your Mac. You can perform this task yourself, with no need for any of the advanced server functions available in OS X Server. You can either use Terminal, or a Security & Privacy option in the system preferences.

Both methods result in the same thing; a login message that will be displayed on your Mac. I’ll show you how to use both methods; the one you decide to use is up to you.

Let's Get Started with the Terminal Method

  1. Launch Terminal, located in /Applications/Utilities.
  2. Terminal will open on your desktop and display its command prompt; usually, your account's short name followed by a dollar sign ($), such as tnelson$.
  3. The command we're going to enter looks like the one below, but before you enter it, take a moment to read on:
    sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Your login window message text goes here"
  4. The command contains three parts, beginning with the word sudo. Sudo instructs Terminal to execute the command with the elevated privileges of a root or administrator user. We need to use the sudo command because the next part of the command is going to make changes to a system file, which requires special privileges.
  5. The second part of the Terminal command is the defaults write, followed by a pathname to the file we're going to make changes to, in this case, /Library/Preferences/com.apple.loginwindow. For this task, we're going to write a new default value into the com.apple.loginwindow plist file.
  1. The third part of the command is the name of the key or preference we wish to change. In this case, the key is LoginwindowText, followed by the text we want to display, contained within quotation marks.
  2. A warning about using text: Exclamation points are not allowed. Other special characters may also be rejected, but exclamation points are a definite no-no. Don’t worry if you enter an invalid character, though. Terminal will return an error message and abort the action of writing to the file; no harm, no foul.
  3. If you've got a message in mind, we're ready to enter it into Terminal.
  4. Enter the text below at the Terminal command prompt. You can type it, or even better, copy/paste it. The text is all on a single line; there are no returns or line breaks, although your browser may display the text in multiple lines:
    sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Your login window message text goes here"
  5. Replace the login window text with your own message; be sure to keep your message between the quotation marks.
  6. When you're ready, press the return or enter key on your keyboard.

The next time you start up your Mac, you'll be greeted with your custom login message.

Reset the Login Window Message Back to Its Original Default Value

To remove the login message text and revert back to the default value of no message being displayed, simply perform the following steps:

  1. Launch Terminal, if it isn't already open.
  2. At the command prompt, enter:
    sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText ""
  3. Press the return or enter key.
  4. Notice that in this command, the login window text was replaced with a pair of quotation marks, with no text or space between them.

Using Security & Privacy Preference Pane

Using a system preference pane may be the easiest method for setting up a login message. The advantage is that you don’t need to work with Terminal and difficult-to-remember text commands.

Launch System Preferences by clicking its icon in the Dock, or selecting System Preferences from the Apple menu.

Select the Security & Privacy preference pane from the available system preferences.

Click the General tab.

Click the lock icon, located in the bottom left corner of the Security & Privacy window.

Enter an administrator password, and then click the Unlock button.

Place a checkmark in the box labeled "Show a message when the screen is locked," and then click the Set Lock Message button.

A sheet will drop down. Enter the message you wish to have displayed in the login window, and then click OK.

The next time anyone logs into your Mac, the message you set up will be displayed.

Resetting the Login Message From the Security & Privacy Preference Pane

If you no longer wish to have a login message be displayed, you can remove the message with this simple method:

  1. Return to System Preferences and open the Security & Privacy preference pane.
  2. Click the General tab.
  3. Unlock the lock icon as you did before.
  4. Remove the checkmark from the box labeled "Show a message when the screen is locked."

That's all there is to it; you now know how to add or remove login window messages.

More From Us