Skip to main content
Question

delete local keychain


Forum|alt.badge.img+7
  • Valued Contributor
  • 74 replies

so for the life of me i can't sort this out. The below works great locally but can't make it work when i push it out via jamf. Save me guys.

security delete-internet-password -s thingiwanttokill

2 replies

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • 7882 replies
  • October 30, 2018

Same issue that comes up daily, maybe even hourly, on this site. It's because most everything run from a jamf policy runs as root. The command you have works fine when in Terminal because you are running it as you, meaning it knows which keychain to look in for the item to delete. Unless you tell it to either run the security command as the user (probably the best approach) or at the very least direct security at the current user's login.keychain, it won't work, because it's actually looking in /private/var/root/Library/Keychains/ for the item. Not gonna be in there.


Forum|alt.badge.img+7
  • Author
  • Valued Contributor
  • 74 replies
  • November 1, 2018

@mm2270

So im looking for something like this?

loggedInUser=$(stat -f%Sgu /dev/console) security delete-internet-password -s /Users/$loggedInUser/Library/Keychains/thing.chathamfinancial.com

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings