Show a saved Wi-Fi password on Mac
Reveal the password of a network your Mac has joined before.
Replace the quoted text with the network name (SSID) and run the command. Enter your Mac account password when prompted — the Wi-Fi password is printed on the next line.
01Command
Command
$ security find-generic-password -wa 'SSID'02What it does
macOS stores Wi-Fi passwords in your login Keychain. The security command reads the AirPort network password item; -w prints the password, -a matches by account (the SSID). Local admin authorization is required, so nobody can read your passwords without your session.
03Risk
!Warning: This exposes a password on screen. Close the terminal window afterwards; never run it while screen-sharing.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- security — keychain command line interfaceEvidence: find-generic-password -w prints the password of a keychain item after local authorization.
Last verified: 2025-11-17 · Category: Security & Privacy