I am having a hard time with deleting a simple value from the login keychain of the logged in user via the CLI, i have tried many commands but non of them will delete the entry, is there anyone who got the golden tip?!
See screenshot for what i am trying to delete, it is a keychain entry from a SMB network printer.
Best answer by ThijsX
Hi,
Created a discussion to fast, figured it out alread. Thanks to @Chris_Hafner for his post on a discussion! Below what worked for me.
#!/bin/sh
#Determine the currently logged in user and save their account name as the loggedInUser
loggedInUser=$( ls -l /dev/console | awk '{print $3}' )
#Delete the specified 'network password' item(s) from the logged in users keychain.
security delete-internet-password -l"Bol.com Multifunctional" /Users/$loggedInUser/Library/Keychains/login.keychain
# Set authentication method to username & password
lpadmin -p bol_com_multifunctional -o auth-info-required=username,password
exit0
Created a discussion to fast, figured it out alread. Thanks to @Chris_Hafner for his post on a discussion! Below what worked for me.
#!/bin/sh
#Determine the currently logged in user and save their account name as the loggedInUser
loggedInUser=$( ls -l /dev/console | awk '{print $3}' )
#Delete the specified 'network password' item(s) from the logged in users keychain.
security delete-internet-password -l"Bol.com Multifunctional" /Users/$loggedInUser/Library/Keychains/login.keychain
# Set authentication method to username & password
lpadmin -p bol_com_multifunctional -o auth-info-required=username,password
exit0
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.