Skip navigation
Documentation

Duo Authentication for macOS

Duo integrates with macOS to add two-factor authentication to macOS console logons.

Walkthrough Video

 

Important Notes

  • Duo's macOS authorization plugin doesn't support inline self-service enrollment. Your users must be enrolled in Duo before logging in, and their Duo usernames must match the macOS username.

  • We recommend using bulk enrollment or directory sync to send your users unique self-enrollment links via email. Read the enrollment documentation to learn more.

  • Once installed, Duo authentication is required for new console logons, but not when unlocking the screensaver or when an already logged-on user wakes the system from sleep.

  • For additional client security, we recommend setting a firmware password to prevent disabling Duo authentication via recovery mode.

  • Major macOS version upgrades (such as from 10.11 El Capitan to 10.12 Sierra) uninstall Duo's Mac Logon package. Reinstall Duo after updating your operating system.

  • Duo for MacOS doesn't require 2FA for remote SSH connectins. Looking for SSH login protection? Try Duo Unix.

Connectivity Requirements

This integration communicates with Duo's service on TCP port 443. Also, we do not recommend locking down your firewall to individual IP addresses, since these may change over time to maintain our service's high availability.

System Requirements

Duo's Mac authorization plugin supports OS X 10.10 (Yosemite) and later macOS versions.

First Steps

  1. Sign up for a Duo account.

  2. Log in to the Duo Admin Panel and navigate to Applications.

  3. Click Protect an Application and locate macOS in the applications list. Click Protect this Application to get your integration key, secret key, and API hostname. (See Getting Started for help.)

  4. We recommend setting the New User Policy for your macOS application to Deny Access, as no unenrolled user may complete Duo enrollment via this application.

  5. Download and uncompress the Duo macOS plugin installer package and scripts zip archive. This zip file contains the the configuration script for the Duo installer package (configure_maclogon.sh) and the Duo plugin installer and uninstaller .pkg package files.

  6. Ensure your Mac system's time is correct. You can set your Mac to obtain the correct time automatically. Open "System Preferences" and then click "Date & Time". On the "Date & Time" tab, check the box next to "Set date and time automatically" and pick a time server for your region from the drop-down list. Click save when done.

Enroll a User

Add your first user to Duo, either manually or using bulk enrollment. The username should match your macOS logon name. You can obtain a list of your Mac's local users with this Terminal command:

dscl . ls /Users | grep -v _

If the user logging in to macOS after the Duo plugin is installed does not exist in Duo, the user may not be able to log in.

If you're not ready to enforce Duo authentication for all users of this system yet, configure the New User Policy for your macOS application to "Allow Access". This only prompts users enrolled in Duo for 2FA approval, and lets user not yet enrolled in Duo log on to the system without seeing the Duo prompt.

Run the Installer Package

  1. Change to the extracted MacLogon directory and run the configuration script:

    ./configure_maclogon.sh

    If the configuration script is in a different directory than the Duo MacLogon .pkg file, specify the full path to MacLogon-NotConfigured-1.0.1.pkg when running the script.

    ./configure_maclogon.sh /path/to/MacLogon-NotConfigured-1.0.1.pkg

    Supply the following information when prompted by the script:

    Enter ikey

    Provide the integration key from the macOS application page in the Duo Admin Panel.

    Enter skey

    Provide the secret key from the macOS application page in the Duo Admin Panel.

    Enter API hostname

    Provide the API hostname from the macOS application page in the Duo Admin Panel.

    Should fail open

    Specify true to allow user logon without completing two-factor authentication if the Duo Security cloud service is unreachable or false to prevent user logon when Duo is unreachable.

    Should bypass 2FA when using smartcard

    Specify true to permit smart card logon as an alternative to Duo authentication after successful submission of primary credential. If a PIV card reader with smart card is attached to the system then the Duo Prompt is not shown. Specify false to disable smart card logon and require Duo 2FA.

    Should auto push if possible

    Specify true to automatically send a Duo Push or phone call authentication request after primary credential validation or false to let the user initiate Duo authentication via interactive factor selection.

    The configuration script creates a new deployment package with the values you specify. For example, this command configures the Duo for macOS installation package located in the same directory as the configuration script, with fail open enabled, smart card login disabled, and auto push enabled, and then creates the deploy package MacLogon-1.0.1.pkg:

    ./configure_maclogon.sh /path/to/DuoSecurity-MacLogon-1.0.1.pkg
    
          ___           ___           ___     
         /\  \         /\__\         /\  \    
        /::\  \       /:/  /        /::\  \   
       /:/\:\  \     /:/  /        /:/\:\  \  
      /:/  \:\__\   /:/  /  ___   /:/  \:\  \
     /:/__/ \:|__| /:/__/  /\__\ /:/__/ \:\__\
     \:\  \ /:/  / \:\  \ /:/  / \:\  \ /:/  /
      \:\  /:/  /   \:\  /:/  /   \:\  /:/  /
       \:\/:/  /     \:\/:/  /     \:\/:/  /  
        \::/__/       \::/  /       \::/  /   
         ~~            \/__/         \/__/    
    
    Enter ikey: DIXXXXXXXXXXXXXXXXX
    Enter skey: gdk2261fhc9c73fdjc9w73ffsi23gdbak282gebsks
    Enter API Hostname: api-xxxxxxxx.duosecurity.com
    Should fail open (true or false): true
    Should bypass 2FA when using smartcard (true or false): false
    Should auto push if possible (true or false): true
    
    Modifying ./MacLogon-NotConfigured-1.0.1.pkg...
    
    Updating config.plist ikey, skey, host, fail_open, smartcard_bypass, and auto_push config...
    
    Finalizing package, saving as ./MacLogon-1.0.1.pkg
    
    Cleaning up temp files...
    
    Done! The package ./MacLogon-1.0.1.pkg has been configured for your use.
  2. Double-click the newly-created Duo MacLogon deploy .pkg file to start installation. Follow the prompts to select the destination disk and enter the sudo password when prompted by the installer.

You'll need to run the script again if you want to change any of the configuration values, then reinstall the package and restart your Mac for the change to take effect.

Verify Duo Configuration

If you want to verify the Duo MacLogon application settings you can view the /private/var/root/Library/Preferences/com.duosecurity.maclogon.plist file. This file is read-only for administrators only.

Do not change the permissions of the com.duosecurity.maclogon.plist file!
$ sudo cat /private/var/root/Library/Preferences/com.duosecurity.maclogon.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>apiurl</key>
        <string>api-xxxxxxxx.duosecurity.com</string>
        <key>fail_open</key>
        <true/>
        <key>ikey</key>
        <string>DIXXXXXXXXXXXXXXXXX</string>
        <key>skey</key>
        <string>gdk2261fhc9c73fdjc9w73ffsi23gdbak282gebsks</string>
        <key>smartcard_bypass</key>
        <true/>
</dict>
</plist>

Test Your Setup

To test your setup, attempt to log in to your newly-configured system as a user enrolled in Duo. The Duo Prompt appears after you successfully submit your macOS credentials.

Duo Prompt on macOS

Select any available factor to verify your identity to Duo:

  • Duo Push: Send a request to your smartphone. You can use Duo Push if you've installed and activated Duo Mobile on your device.
  • Call Me: Perform phone callback authentication.
  • Passcode: Log in using a passcode generated with Duo Mobile, received via SMS, generated by your hardware token, or provided by an administrator. To have a new batch of SMS passcodes sent to you click the Send me new codes button. You can then authenticate with one of the newly-delivered passcodes.

Troubleshooting

Need some help? Take a look at our macOS Logon Knowledge Base articles or Community discussions. For further assistance, contact Support.

Network Diagram

Duo Mac Logon Network Diagram

  1. Primary authentication at Mac console
  2. Duo macOS Logon connection established to Duo Security over TCP port 443
  3. Secondary authentication request via Duo Security’s service
  4. User approves Duo authentication request
  5. Authentication response from Duo sent to Mac authentication plugin
  6. Console session logged in

Ready to Get Started?

Sign Up Free