I'm having trouble deleting the github credentials from Keychain Access. Keychain Access just freezes everytime I try. Is there a command to force deletion of an item in the Keychain from the terminal?

  • Perhaps you question should be how to fix Keychain? – user14492 Apr 29 '16 at 17:50
  • Why would I ask a more general question for a specific case? – Awesome-o Apr 29 '16 at 22:53
  • Because you're not solving the problem just working around it. Others could have a similar problem so it would help them too. – user14492 Apr 29 '16 at 22:54
  • Problem was definitely solved. It was just a crude solution. Consider, what if someone would like to know how to delete a password from terminal for a different reason? This questions will still help that general case. – Awesome-o Apr 30 '16 at 0:17

You may first try to find the credentials (or better the blob):

security find-internet-password -l "github.com"  /Users/user_name/Library/Keychains/login.keychain

Then delete them with:

security delete-internet-password -l "github.com"  /Users/user_name/Library/Keychains/login.keychain

If you have several github.com items you have to repeat this. Create a backup of your login.keychain (or better the whole Keychain folder) before proceeding.

|improve this answer|||||

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .