Last active
December 12, 2015 03:38
-
-
Save martinsnygg/4708232 to your computer and use it in GitHub Desktop.
Randomizes MAC id and hostname on OS X 10.8.2
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
#!/bin/bash | |
# diassociate from wireless network and flush cache | |
sudo airport -z | |
dscacheutil -flushcache | |
# set random MAC id on en0 | |
sudo ifconfig en0 ether `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'` | |
# set random hostname | |
sudo scutil --set HostName `openssl rand -hex 3`.local | |
# write new hostname to netBIOS | |
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName $HOSTNAME | |
echo Don´t forget to reconnect wifi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment