Get a Saved Website Password from the Keychain
Look up passwords Safari saved for websites using security find-internet-password.
Run security find-internet-password -s example.com -w to print the website password saved in your login keychain.
01Command
Command
$ security find-internet-password -s accounts.example.com -w02What it does
Safari passwords live in the keychain as 'internet passwords', a separate store from the generic passwords used by apps. The -s flag matches the server name and -w prints just the password itself. Leave off -w to see the full metadata — username, protocol, creation date — which helps when a site uses several accounts.
03Risk
!Warning: macOS will prompt for your login password (or Touch ID) once per command use. Anyone with access to your unlocked Terminal session can retrieve these passwords, so never run this on a shared or unattended Mac.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- security - keychain command line interfaceEvidence: Documents security find-internet-password with the -s server selector and -w password output.
Last verified: 2026-09-18 · Category: Security & Privacy