It's quite common to need to connect a new device to a wireless network but have long forgotten the password. Fortunately, the operating system macOS Automatically saves access keys for networks you've ever logged into. This makes it easy to restore internet access without having to reset your router or find your ISP contract.
Unlike some mobile platforms, where viewing saved data can be hidden, on Apple computers this feature is deeply embedded into the security system. You don't need third-party programs or complex hacks. All you need is to know where to look in the system settings.
There are two main ways to extract this information: through the Keychain Access graphical interface and using the Terminal command line. The first method is more visual and suitable for most users, while the second is for those who prefer speed and working with code. Both options are secure and don't require superuser privileges beyond standard authorization.
Using iCloud Keychain to Find Passwords
The main repository of secret data in the Apple ecosystem is the utility Bunch of keysThis is where the system stores logins, website passwords, certificates, and Wi-Fi access keys. To use this tool, you need to open the program through Spotlight search by pressing Cmd + Space and entering the name of the utility.
After launching the app, a list of all saved entries will open. In the left column, ensure the "Passwords" or "All Key Objects" category is selected. In the search bar in the upper right corner of the window, enter the name of your wireless network (SSID). The system will instantly filter the list and display the desired entry.
Double-click the found network name to open the Properties window. In the dialog box that opens, find the "Show password" checkbox. Clicking it will prompt the system to verify your identity. You'll need to enter your Mac user account password or use Touch ID if your computer has Touch ID.
⚠️ Note: If you're using a corporate computer, access to Keychain may be restricted by your organization's security policies. In this case, the standard method may not work.
After successful authorization, the required access code will appear in plain text in the field next to the checkbox. You can copy it, highlight it with your mouse, or simply rewrite it. This is the most reliable method and works on all current versions. macOS, from Catalina to Sonoma.
Finding a password using the Terminal command line
For users who are comfortable with the keyboard, there's a faster way to access saved data without navigating through menus. Command Prompt Terminal Allows you to query the security system directly. Open Terminal via Launchpad or Spotlight search.
In the terminal window, you need to enter a special command that will access the key database. The command syntax requires the network name. It looks like this:
security find-generic-password -wa "YourNetworkName"
Replace the text in quotation marks with the actual name of your Wi-Fi router. If there are spaces in the network name, be sure to leave the quotation marks. After entering the command, press EnterThe system will immediately request permission to access the security key. Enter your administrator password or place your finger on the scanner.
If everything is done correctly, the terminal will immediately display the password as a string of characters. This method is especially convenient if you need to copy the key for pasting into the configurator or sharing with another user, as the result can be easily selected and copied.
View passwords in Settings on macOS Ventura and later
Since version macOS VenturaApple has significantly simplified account management by moving it into the main System Preferences. The interface now more closely resembles iOS mobile, making the process more intuitive. You no longer need to search for individual utilities in the Applications folder.
Open the Apple menu in the upper left corner of the screen and select "System Preferences." In the sidebar, find the "Wi-Fi" section. On the right side of the window, scroll down to the bottom of the list, where you'll see either the "Advanced" button or a list of known networks, depending on the update version.
In more recent updates such as Sonoma or SequoiaNext to each known network, you may see an information icon or three dots. Clicking on them will take you to the connection details. There you'll find a "Password" field with hidden characters. Click it, authenticate, and the password will become visible.
| macOS version | Location of settings | Necessary action |
|---|---|---|
| Monterey and older | Keychain Access | Finding an object and unchecking it |
| Ventura | System Preferences → Wi-Fi → Known Networks | Click on the "i" icon next to the network |
| Sonoma+ | System Preferences → Wi-Fi → Details | Click on the hidden password field |
This centralization of settings simplifies life for users accustomed to managing everything from a single screen. However, it's worth keeping in mind that the menu's appearance may vary slightly depending on the screen size and resolution.
Sync passwords via iCloud on iPhone and iPad
One of the strengths of the Apple ecosystem is its deep integration across devices. If you have the same Apple ID account and syncing enabled on your Mac and iPhone, iCloud Keychain, then passwords saved on your computer automatically become available on your smartphone and tablet.
This means that if you've forgotten your Mac's Wi-Fi password but previously connected to the same network from your iPhone, you can find the code on your phone. Go to Wi-Fi settings on iOS, tap the information icon next to the network, and tap the hidden password field. Face ID or Touch ID will unlock access.
The feedback also works flawlessly. After connecting a new device to the network via your iPhone, you'll see the password in Keychain on your MacBook within seconds. This eliminates the need to manually enter long character combinations on each device.
⚠️ Note: For syncing to work, two-factor authentication must be enabled on all your Apple ID devices. Without it, iCloud Keychain will not activate.
Make sure all your devices are updated to the latest OS version. Older versions of iOS or macOS may not sync correctly with new types of security key encryption.
☑️ Check iCloud sync
Troubleshooting Keychain Access Issues
Sometimes users encounter a situation where the system prevents them from viewing their password, displaying access errors or requiring them to reset Keychain. This can occur after a system update, an account password change, or damage to system files. Keychain Manager — is a powerful tool, but it is sensitive to desynchronization.
If you've forgotten your macOS login password, you won't be able to view your saved Wi-Fi passwords, as they're encrypted with that key. In this case, you'll need to reset your user password via Apple ID or recovery mode, which will create a new Keychain, and old passwords may be lost if you didn't have a backup.
Problems can also occur if the key database file is corrupted. In this case, you can try restoring it from a Time Machine backup. Locate the file login.keychain-db in the folder ~/Library/Keychains/ and replace it with the working version from the backup.
In rare cases, deleting the lock file helps. Close Keychain Access, go to the keys folder, and delete files with the extension .lockAfter restarting the computer, the system will create new lock files, and access may be restored.
What should you do if Keychain Access requires a password you don't remember?
If the system constantly asks for a Keychain password that you haven't changed (or don't remember), it may be out of sync. Try creating a new Keychain: in the Keychain app, select File → Add New Keychain. Name it "login" and enter a new password. Then, make it the default keychain. Old passwords will remain in the old keychain, but new ones will be saved in the new one.
Security measures when working with access keys
When accessing saved passwords, it's important to understand the risks involved. This data provides access not only to the internet but also to the local network, which may contain printers, NAS storage, or smart home devices. Security your network directly depends on the complexity of the stored key.
If you see that your password is a simple string of numbers or words like "password123," we strongly recommend changing it in your router settings. After changing the password on your router, your Mac will prompt you to forget the old network and reconnect, updating the entry in Keychain.
Never send screenshots or text files containing Keychain passwords via unencrypted messaging apps. Attackers often search for this type of data in chat logs. Instead, use the built-in AirDrop feature to securely transfer your passkey to your friends' or guests' Apple devices.
⚠️ Note: Settings interfaces and menu item locations may change with the release of new macOS versions. If you don't see the item you're looking for, check the Apple documentation for your specific operating system version.
Regularly check the list of known networks in your Wi-Fi settings. Delete those you no longer use or those that are in public places. This will reduce the risk of automatically connecting to rogue hotspots with similar names.
Frequently Asked Questions (FAQ)
Can I view my Wi-Fi password if I'm not currently connected to the network?
Yes, you can. Keychain stores a history of all the networks you've ever connected to, even if you're currently out of range or the network is hidden. The key is that the network's record is saved in the macOS database.
Where is the password file physically stored on a Mac?
The Keychain files are located in a hidden system folder at /Users/UserName/Library/Keychains/. The main files have the extension .keychain-dbDirect editing of these files with text editors is prohibited and may result in data loss.
What should I do if my Mac asks for my Keychain password every time I start it?
This happens if the account password has been changed, but the Keychain hasn't been updated. When prompted for the old password, leave the field blank or tap "Cancel," then select "Create a new Keychain" or "Reset Default Keychain" in the Keychain app.
Are Wi-Fi passwords transferred automatically via AirDrop?
Yes, as long as both devices (the sender and the recipient) are in each other's contacts and have Bluetooth and Wi-Fi enabled. When attempting to connect to the network on the recipient's device, a notification will appear on the sender's device asking if they want to share the password.
Is it possible to export all passwords from Keychain to a text file?
Technically, this is possible via the File → Export menu, but Apple strongly discourages this for security reasons. The exported file will contain sensitive data in unencrypted form, making it vulnerable to theft.