View Your Keychain Search List with security list-keychains

See which keychains macOS searches — and in what order — when apps look up passwords and certificates.

macOSKeychainsecuritysearch-listMedium risk
Run `security list-keychains` to print the user's keychain search list in priority order.

01Command

Command
$ security list-keychains

02What it does

macOS searches keychains in a defined order until a credential is found; security list-keychains shows that list while security default-keychain shows which one new items go to. The -s flag can reorder it or add a custom keychain for isolated secrets. Related forgotten verbs include create-keychain, unlock-keychain (widely used in CI), and dump-keychain for auditing entries.

03Risk

RiskMedium risk
RequirementsBuilt-in on macOS.
!Warning: Reordering the search list changes which duplicate credential wins; record the current output before changing it.

04Undo

Undo
$ security list-keychains -s "$(security list-keychains | sed 's/"//g' | tr '\n' ' '")

05Sources

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

06Related solutions