I have a set of laptops I'm using as a testbed and need a way to remotely configure their networking settings when I install new ones.

I'm hoping to avoid a solution that scripts the GUI via AppleScript to simulate mouse/keyboard actions.

Is it possible to change 802.1X settings in OS X from the command line?

With EAP-TLS, manipulating certificates, identity preferences and a single password entry all in keychain access can be done from the command line.

Something like:

security import ${PK12} -A -x -k login.keychain -P ${PW}

security set-identity-preference -c ${CN} -Z ${FINGERPRINT} -s com.apple.network.eap.user.identity.default

security set-identity-preference -c ${CN} -Z ${FINGERPRINT} -s com.apple.network.eap.user.identity.wlan.ssid.${SSID}

security add-generic-password -a ${USER} -D "802.1X Password" -l Default -s com.apple.network.eap.user.item.default -T /System/Library/SystemConfiguration/EAPOLController.bundle/Contents/Resources/eapolclient 

security add-generic-password -a ${USER} -D "802.1X Password" -l ${SSID} -s com.apple.network.eap.user.item.wlan.ssid.${SSID} -T /System/Library/SystemConfiguration/EAPOLController.bundle/Contents/Resources/eapolclient

com.apple.network.eap.user.item.default and com.apple.network.eap.user.identity.default are for wired 802.1X.

com.apple.network.eap.user.item.wlan.ssid.${SSID} and com.apple.network.eap.user.identity.wlan.ssid.${SSID} are for 802.1X on wireless SSID ${SSID}.

  • John, consider adding some details about what each command does. It's helpful when people know what is being done and why. – Allan Apr 5 '16 at 17:11

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.