I'm signed into my MacOS laptop but I forgot my Wi-fi password so I can't connect other devices. Can I use the command line to enumerate the Wi-fi profiles and passwords for each?
I'm signed into my MacOS laptop but I forgot my Wi-fi password so I can't connect other devices. Can I use the command line to enumerate the Wi-fi profiles and passwords for each?
Yes, you can view saved Wi-Fi passwords on macOS using the Terminal. Here's how: 1. Open Terminal (from Applications > Utilities or using Spotlight search) 2. Enter this command to list all saved Wi-Fi networks:
1 | security find-generic-password -ga "NETWORK_NAME" | grep "password:" |
1 | networksetup -listpreferredwirelessnetworks en0 |
Testing if the previous output contains the string -ga
: True
Testing if the previous output contains the string -wa
: False
Testing if the previous output contains the string security find-generic-password
: True
I'm signed into my MacOS laptop but I forgot my Wi-fi password so I can't connect other devices. Can I use the command line to enumerate the Wi-fi profiles and passwords for each?
I'm signed into my MacOS laptop but I forgot my Wi-fi password so I can't connect other devices. Can I use the command line to enumerate the Wi-fi profiles and passwords for each?
Yes, you can view saved Wi-Fi passwords on macOS using the Terminal. Here's how: 1. Open Terminal (you can find it in Applications > Utilities or use Spotlight search) 2. Run this command:
1 | security find-generic-password -ga "WIFI_NAME" -w |
1 | security dump-keychain | grep "AirPort network password" |
1 | networksetup -listpreferredwirelessnetworks en0 |
Testing if the previous output contains the string -ga
: True
Testing if the previous output contains the string -wa
: False
Testing if the previous output contains the string security find-generic-password
: True
I'm signed into my MacOS laptop but I forgot my Wi-fi password so I can't connect other devices. Can I use the command line to enumerate the Wi-fi profiles and passwords for each?
I'm signed into my MacOS laptop but I forgot my Wi-fi password so I can't connect other devices. Can I use the command line to enumerate the Wi-fi profiles and passwords for each?
Yes, you can view saved Wi-Fi passwords on macOS using the Terminal. Here's how:
1 | security find-generic-password -ga "WIFI-NAME" -w |
1 | security dump-keychain | grep "AirPort network password" |
1 | defaults read /Library/Preferences/SystemConfiguration/com.apple.airport.preferences | grep SSIDString |
Testing if the previous output contains the string -ga
: True
Testing if the previous output contains the string -wa
: False
Testing if the previous output contains the string security find-generic-password
: True
I'm signed into my MacOS laptop but I forgot my Wi-fi password so I can't connect other devices. Can I use the command line to enumerate the Wi-fi profiles and passwords for each?
I'm signed into my MacOS laptop but I forgot my Wi-fi password so I can't connect other devices. Can I use the command line to enumerate the Wi-fi profiles and passwords for each?
Yes, you can view saved Wi-Fi passwords on macOS using the Terminal. Here's how:
1 | security find-generic-password -ga "WIFI-NAME-HERE" | grep "password:" |
1 | security dump-keychain | grep -A 5 "AirPort" |
1 | defaults read /Library/Preferences/SystemConfiguration/com.apple.airport.preferences | grep SSIDString |
Testing if the previous output contains the string -ga
: True
Testing if the previous output contains the string -wa
: False
Testing if the previous output contains the string security find-generic-password
: True
I'm signed into my MacOS laptop but I forgot my Wi-fi password so I can't connect other devices. Can I use the command line to enumerate the Wi-fi profiles and passwords for each?
I'm signed into my MacOS laptop but I forgot my Wi-fi password so I can't connect other devices. Can I use the command line to enumerate the Wi-fi profiles and passwords for each?
Yes, you can view saved Wi-Fi passwords on macOS using the Terminal. Here's how: 1. Open Terminal (Applications > Utilities > Terminal) 2. Run this command to show all saved Wi-Fi networks:
1 | security find-generic-password -ga "WIFI_NETWORK_NAME" | grep "password:" |
1 | security dump-keychain | grep -A 5 "AirPort" |
1 | defaults read /Library/Preferences/SystemConfiguration/com.apple.airport.preferences KnownNetworks |
Testing if the previous output contains the string -ga
: True
Testing if the previous output contains the string -wa
: False
Testing if the previous output contains the string security find-generic-password
: True