Created
July 12, 2022 01:57
-
-
Save benkant/6954638d1c4f6e18724c451e0c7678d3 to your computer and use it in GitHub Desktop.
Set en0 to a random MAC address on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Set en0 to a random MAC address on macOS | |
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z | |
openssl rand -hex 6 | sed 's!\.!!g;s!\(..\)!\1:!g;s!:$!!' | xargs -t -0 sudo ifconfig en0 lladdr | |
sudo ifconfig en0 up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment