Skip to content

Instantly share code, notes, and snippets.

@gjpalau
Created July 20, 2015 23:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gjpalau/500258474096dbaf83b4 to your computer and use it in GitHub Desktop.
Save gjpalau/500258474096dbaf83b4 to your computer and use it in GitHub Desktop.
This script should take care of any issues with the keychain by making sure it has been completely removed, so that it will be created from scratch when a new user logs in.
#!/bin/bash
\#
\# keychain-clean.sh
\# cleans and disinfects keychains
\#
if [ -d "/Users/default/Library/Keychains" ]; then
/bin/rm -rf /Users/default/Library/Keychains
fi
/bin/mkdir /Users/default/Library/Keychains
/usr/sbin/chown default:staff /Users/default/Library/Keychains
/bin/chmod 700 /Users/default/Library/Keychains
/usr/bin/rsync -a --delete /Users/default/ /System/Library/User\ Template/English.lproj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment