Get a Saved Website Password from the Keychain

Look up passwords Safari saved for websites using security find-internet-password.

macOSpasswordsKeychainsecurityMedium risk
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 -w

02What 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

RiskMedium risk
!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

Last verified: 2026-09-18 · Category: Security & Privacy

06Related solutions