So in the spirit of this question I was wondering if it is possible to disable automatic 802.1X connection via terminal as well.
Am I right to assume that this is a computer setting (meaning that if I run this script with no user logged in it still disables it for all existing and future users)?
Removing the automatic connection for 802.1X via terminal
Networkterminal
Related Question
- MacOS – Script to change Computername/hostname causing bizarre Terminal behavior
- MacOS – launchctl error “nothing found to load” when run via cron
- Shortcut for dragging and dropping a tab on terminal
- Can we use Apple Remote Desktop to hold internal meetings screen to screen over LAN ? Like Join.me
- Terminal – How to Enable Automatic Login on macOS via Terminal
- Access Fast User Switching from a script in Big Sur
Best Answer
It took me some hours to learn that it's a boolean value (and not just 0 or 1 as 'defaults' would report) but finally i came up with the following LoginHook which does the trick. As LoginHooks get executed as root user, you have to 'su' to the user currently being logged in before running the script below. As Michele points out below, that username is available as $1 to the Hook-Script running as root. It seems to be a user byHost-Setting, although SystemPrefs would ask for a admin password to tweak this setting... My hook script being executed in user-context looks like this:
Using opensnoop(1) or fs_usage(1) I could not see any other files being modified. Hope it helps.