Skip to content

Instantly share code, notes, and snippets.

@zoonderkins
Forked from nixpulvis/change-mac.sh
Created July 9, 2025 02:12
Show Gist options
  • Save zoonderkins/3323d95aa7ba7eab27e43977bc6ce9f0 to your computer and use it in GitHub Desktop.
Save zoonderkins/3323d95aa7ba7eab27e43977bc6ce9f0 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment