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.
Run `security list-keychains` to print the user's keychain search list in priority order.
01Command
Command
$ security list-keychains02What 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
!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
- security — keychain management commands (macOS)Evidence: Documents list-keychains, and -s to set the user's keychain search list, plus create-keychain and unlock-keychain verbs.
Last verified: 2026-09-17 · Category: Security & Privacy