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?– user14492Apr 29, 2016 at 17:50
-
Why would I ask a more general question for a specific case?– Awesome-oApr 29, 2016 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.– user14492Apr 29, 2016 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-oApr 30, 2016 at 0:17
1 Answer
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.