How To Find the WiFi Password on Mac OS X

I‘ve MBP 13″ laptop. How can I find out the Wifi password on Mac OS X using command line and GUI options?

OS X stores your WiFI details including password in Keychain password management system. You can use this tool, [donotprint]
Tutorial details
Difficulty Easy (rss)
Root privileges No
Requirements None
Time 5m
[/donotprint]if you do not remember the password of particular WiFi network on Apple Mac OS X. There are two methods to get the WiFI password as follows:

ADVERTISEMENTS

#1: Display the WiFi Password on Mac OS X Using CLI

You can use the security command. It is a command line interface to keychains and Security framework which stores your WiFI password and other information. Open the Terminal app and type the following command:

security find-generic-password -ga YOUR-ACCOUNT-NAME
security find-generic-password -ga SSID-HERE
security find-generic-password -ga YOUR-WiFi-Access-Point-Name-Here

In this example, find the Wifi password for Iphone4s access point (SSID):

security find-generic-password -ga Iphone4s | grep -i password

OR

security find-generic-password -ga Iphone4s

You will be promoted to enter your own username and password as follows:

Fig.01 Type admin user account and password

Fig.01 Type admin user account and password

You will see password and username as follows (note the last line ‘password: "9D10bZz@S9A^iRpQ"‘):
Fig.02: OS X AirPort network password

Fig.02: OS X AirPort network password

#2: Not a Fan of Command Line Tools?

The System Keychain is a utility which securely stores all passwords and user IDs for a user and lets that user unlock them all with a single master password.

System Keychain Location

  • Open Spotlight to start a search by pressing Command (⌘)-Space bar
  • In the search field type: keychain access
  • Click on Keychain Access
Fig.03: Find the system keychain on OS X Yosemite

Fig.03: Find the system keychain on OS X Yosemite

Next, click on the “login“, select “Password“, and in the search filed type access point name “Iphone4s“:
Fig.04: Searching for Iphon4s access point password

Fig.04: Searching for Iphon4s access point password

Finally, to copy the WiFi password press Shift(⇧) – Command(⌘) – C to copy password to the clipboard. Again you will be promoted to enter admin account username and password:
Fig.05: Type admin user account and password

Fig.05: Type admin user account and password

Once authenticated successfully you can paste the WiFi password in the Terminal app or text editor by pressing Command(⌘)-V:

9D10bZz@S9A^iRpQ
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
4 comments… add one
  • Tom Jul 27, 2015 @ 12:17

    Hey,

    Can I see Ubuntu instructions please?

    • Lars Jul 27, 2015 @ 12:43

      cat /etc/NetworkManager/system-connections/ | grep psk

  • ITStaff@CIT Jul 27, 2015 @ 12:22

    Don’t suppose anyone has an equivalent for Linux?

  • Sudev Jul 28, 2015 @ 10:11

    cat /etc/NetworkManager/system-connections/YOUR-WIFI-NAME

    May have to do this as SU or under SUDO

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.