Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Reference: https://support.apple.com/en-us/HT208372

Configure macOS for smart card-only authentication

Smart card authentication provides strong two-factor authentication in macOS Sierra and later. macOS High Sierra 10.13.2 and later support smart card-only authentication for the mandatory use of a smart card, which disables all password-based authentication. 

This article is intended for system administrators who set security policy in enterprise environments that require smart card authentication. 

Enable smart card-only login

Make sure that you carefully follow these steps to ensure that users will be able to log in to the computer.

...

For more information about using smart card services, see the macOS Deployment Guide or open Terminal and enter man SmartCardServices.


Disable smart card-only authentication

If you manually manage the profiles that are installed on the computer, you can remove the smart card-only profile in two ways. You can use the Profiles pane of System Preferences, or you can use the /usr/bin/profiles command-line tool. For more information, open Terminal and enter man profiles.

...

  1. Turn on your Mac, then immediately press and hold Command-R to start up from macOS Recovery. Release the keys when you see the Apple logo, a spinning globe, or a prompt for a firmware password. 
  2. Select Disk Utility from the Utilities window, then click Continue.
  3. From the Disk Utility sidebar, select the volume that you're using, then choose File > Mount from the menu bar. (If the volume is already mounted, this option is dimmed.) Then enter your administrator password when prompted.
  4. Quit Disk Utility.
  5. Choose Terminal from the Utilities menu in the menu bar.
  6. Delete the Configuration Profile Repository. To do this, open Terminal and enter the following commands.
    In these commands, replace <volumename> with the name of the macOS volume where the profile settings were installed. 
    rm /Volumes/<volumename>/var/db/ConfigurationProfiles/MDM_ComputerPrefs.plist
    rm /Volumes/<volumename>/var/db/ConfigurationProfiles/.profilesAreInstalled
    rm /Volumes/<volumename>/var/db/ConfigurationProfiles/Settings/.profilesAreInstalled
    rm /Volumes/<volumename>/var/db/ConfigurationProfiles/Store/ConfigProfiles.binary
    rm /Volumes/<volumename>/var/db/ConfigurationProfiles/Setup/.profileSetupDone
  7. When done, choose Apple () menu > Restart.
  8. Reinstall all the configuration profiles that existed before you enabled smart card-only authentication.


Configure Secure Shell Daemon (SSHD) to support smart card-only authentication

Users can use their smart card to authenticate over SSH to the local computer or to remote computers that are correctly configured. Follow these steps to configure SSHD on a computer so that it supports smart card authentication. 

...

ssh-add -s /usr/lib/ssh-keychain.dylib


Enable smart card-only for the SUDO command

Use the following command to back up the /etc/pam.d/sudo file:

...

# sudo: auth account password session
auth        sufficient    pam_smartcard.so
auth        required      pam_opendirectory.so
auth        required      pam_deny.so
account     required      pam_permit.so
password    required      pam_deny.so
session     required      pam_permit.so


Enable smart card-only for the LOGIN command

Use the following command to back up the /etc/pam.d/login file:

...

# login: auth account password session
auth        sufficient    pam_smartcard.so
auth        optional      pam_krb5.so use_kcminit
auth        optional      pam_ntlm.so try_first_pass
auth        optional      pam_mount.so try_first_pass
auth        required      pam_opendirectory.so try_first_pass
auth        required      pam_deny.so
account     required      pam_nologin.so
account     required      pam_opendirectory.so
password    required      pam_opendirectory.so
session     required      pam_launchd.so
session     required      pam_uwtmp.so
session     optional      pam_mount.so


Enable smart card-only for the SU command

Use the following command to back up the /etc/pam.d/su file:

...

# su: auth account password session
auth        sufficient    pam_smartcard.so
auth        required      pam_rootok.so
auth        required      pam_group.so no_warn group=admin,wheel ruser root_only fail_safe
account     required      pam_permit.so
account     required      pam_opendirectory.so no_check_shell
password    required      pam_opendirectory.so
session     required      pam_launchd.so


Sample smart card-only configuration profile

Here’s a sample smart card-only configuration profile. You can use it to see the kinds of keys and strings that this type of profile includes.

<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadDescription</key>
<string>Configures smart card-only</string>
<key>PayloadDisplayName</key>
<string>Smart card-only</string>
<key>PayloadIdentifier</key>
<string>com.apple.configprofile.78.</string>
<key>PayloadOrganization</key>
<string>Apple</string>
<key>PayloadType</key>
<string>com.apple.security.smartcard</string>
<key>PayloadUUID</key>
<string>5A15247B-899C-474D-B1D7-DBD82BDE5678</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>UserPairing</key>
<false/>
<key>allowSmartCard</key>
<true/>
<key>checkCertificateTrust</key>
<false/>
<key>enforceSmartCard</key>
<true/>
</dict>
</array>
<key>PayloadDescription</key>
<string>Smartcard profile.</string>
<key>PayloadDisplayName</key>
<string>Smart card-only</string>
<key>PayloadIdentifier</key>
<string>com.apple.configprofile.77</string>
<key>PayloadOrganization</key>
<string></string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadScope</key>
<string>system</string>
<key>PayloadUUID</key>
<string>7D34CC86-C707-44D2-9A9F-C5F6E347BD77</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>



Content by Label
showLabelsfalse
max5
spacesPM
showSpacefalse
sortmodified
reversetrue
typepage
excerptTypesimple
cqllabel in ("kb-how-to-article","macos","ctk","cryptotokenkit") and type = "page" and space = "DEMTHSP"
labelskb-troubleshooting-article

Was this answer helpful?

Please rate & help us to improve our FAQ.

Rate