The script is created following Sun Knudsen's How to spoof MAC address and hostname automatically at boot on macOS tutorial. The repo is set up so that people can clone and contribute to make it better.
- Clone the repo
- Run
sudo cp ./local.spoof.plist /Library/LaunchDaemons/local.spoof.plist
- make sure com.apple.loginwindow does not exist:
sudo defaults read com.apple.loginwindow
- Run
sudo defaults write com.apple.loginwindow LogoutHook "./spoof-hook.sh"
- Restart the computer. Check and confirm the “Spoofed hostname” is random and "Spoofed MAC address" does not match "hardware MAC address" by running
./show-mac-info.sh
sudo unlink /Library/LaunchDaemons/local.spoof.plist
- Delete user default
sudo defaults delete com.apple.loginwindow LogoutHook
- set computer name, local hostname and hostname
sudo scutil --set ComputerName "Your_name's MacBook Pro" sudo scutil --set LocalHostName "Your_names-MacBook-Pro" sudo scutil --set HostName "Your_names-MacBook-Pro"