Posted on 09-28-2017 12:38 AM
Hi,
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.
Solved! Go to Solution.
Posted on 09-28-2017 02:48 AM
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
exit 0
Posted on 09-28-2017 02:48 AM
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
exit 0