Removing a singular SSID from Keychain

adamdancaster
New Contributor

I've seen some discussions already dotted around but not much has helped so far.

We have successfully used a script that will remove the SSID from a Mac but after a reboot, you are still left with the SSID details in Keychain.

Is there a way (script?) to remove this? I want to test it using terminal first.

1 ACCEPTED SOLUTION

geoffrepoli
Contributor

For WPA2 Enterprise networks, this has worked for us:

su "$loggedInUser" -c '/usr/bin/security delete-generic-password -s com.apple.network.eap.user.item.wlan.ssid.<SSID NAME>'

I'm using it in this script.

Someone might be able to chime in on the name of the keychain item for a standard WPA/WPA2 SSID, which you can just replace the com.apple.network.eap.user.item.wlan.ssid.<SSID NAME> portion with.

View solution in original post

3 REPLIES 3

geoffrepoli
Contributor

For WPA2 Enterprise networks, this has worked for us:

su "$loggedInUser" -c '/usr/bin/security delete-generic-password -s com.apple.network.eap.user.item.wlan.ssid.<SSID NAME>'

I'm using it in this script.

Someone might be able to chime in on the name of the keychain item for a standard WPA/WPA2 SSID, which you can just replace the com.apple.network.eap.user.item.wlan.ssid.<SSID NAME> portion with.

Malcolm
Contributor II

wpa2 system based conenction

sudo security delete-generic-password -l "SSIDNAME" "/Library/Keychains/System.keychain"

Malcolm
Contributor II

Dont ask me how to delete ones synced to iCloud though. @geoffrepoli