Delete a Saved Password from the Keychain

Remove an obsolete generic-password item (app or service password) from the login keychain with the security command.

macOSpasswordsKeychainsecurityMedium risk
Run `security delete-generic-password -s "ServiceName"` to permanently delete that saved password item.

01Command

Command
$ security delete-generic-password -s "MyOldService"

02What it does

This deletes the same item as clicking 'Delete' in Keychain Access, matched by service name (or label/account with -a and -l). For saved website passwords use `delete-internet-password` instead. macOS won't warn you if the service re-saves the password later, so also disable saving in the app that created it if you don't want it back.

03Risk

RiskMedium risk
RequirementsDeletion is permanent; find the exact service name first with `security dump-keychain` or Keychain Access.
!Warning: Deletion is immediate and unrecoverable — confirm the exact service name before running it.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

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

06Related solutions