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.
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
!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
- security — administer Keychains and key items (macOS man page)Evidence: Documents `security delete-generic-password [-s service]` and `delete-internet-password` to remove items from a keychain.
- Keychain data protection on MacEvidence: Describes how the keychain stores passwords and credentials as protected items that can be managed and removed.
Last verified: 2026-09-18 · Category: Security & Privacy