5

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?

1 Answer 1

5

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}.

1
  • 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, 2016 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .