Skip to content

Instantly share code, notes, and snippets.

@nixpulvis
Created January 20, 2016 19:34
Show Gist options
  • Save nixpulvis/d83c0ae70a4c3a06797b to your computer and use it in GitHub Desktop.
Save nixpulvis/d83c0ae70a4c3a06797b to your computer and use it in GitHub Desktop.
Change your MAC address on OS X.
#!/bin/bash
ssid=$(networksetup -getairportnetwork en0 | cut -d ":" -f 2 | sed "s/^[ \t]*//")
sudo airport -z
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.\$//")
networksetup -setairportnetwork en0 "$ssid"
@jamesmcnamara
Copy link

Useful for coffee shops and airports alike!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment