07-11-2023 02:34 AM - edited 07-11-2023 02:35 AM
I need to make a script that will clear all safari data, I found some commands that mostly work but I can't get rid of one thing saved microsoft account during SSO login, the only way that works is to delete safari history via GUI, but i need to do it using CLI.
Commands I've tried so far
osascript -e 'quit app "Safari"'
rm -Rf /Users/$3/Library/Cookies/*;
rm -Rf /Users/$3/Library/Cache/*;
rm -Rf /Users/$3/Library/Safari/*;
rm -Rf /Users/$3/Library/Caches/Apple\ -\ Safari\ -\ Safari\ Extensions\ Gallery
rm -Rf /Users/$3/Library/Caches/Metadata/Safari
rm -Rf /Users/$3/Library/Caches/com.apple.Safari
rm -Rf /Users/$3/Library/Caches/com.apple.WebKit.PluginProcess
rm -Rf /Users/$3/Library/Cookies/Cookies.binarycookies
rm -Rf /Users/$3/Library/Preferences/Apple\ -\ Safari\ -\ Safari\ Extensions\ Gallery
rm -Rf /Users/$3/Library/Preferences/com.apple.Safari.LSSharedFileList.plist
rm -Rf /Users/$3/Library/Preferences/com.apple.Safari.RSS.plist
rm -Rf /Users/$3/Library/Preferences/com.apple.Safari.plist
rm -Rf /Users/$3/Library/Preferences/com.apple.WebFoundation.plist
rm -Rf /Users/$3/Library/Preferences/com.apple.WebKit.PluginHost.plist
rm -Rf /Users/$3/Library/Preferences/com.apple.WebKit.PluginProcess.plist
rm -Rf /Users/$3/Library/PubSub/Database
rm -Rf /Users/$3/Library/Saved\ Application\ State/com.apple.Safari.savedState
Posted on 07-11-2023 11:00 AM
Have you tried clearing Kerberos tickets?
Posted on 07-11-2023 11:16 PM
I have never heard about this before.
Posted on 07-12-2023 04:22 AM
Try running kdestroy in terminal. Kerberos tickets are one of the methods that are used to pass around identities.
https://uit.stanford.edu/service/ess/mac/docs/kerberos_macOS