Advertisement
xosski

MacOS security

Oct 29th, 2024 (edited)
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Read the current configuration
  4. sudo security authorizationdb read system.preferences.security > /tmp/system_preferences_security.plist
  5.  
  6. # Create the new plist content
  7. cat <<EOF > /tmp/system_preferences_security.plist
  8. <?xml version="1.0" encoding="UTF-8"?>
  9. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  10. <plist version="1.0">
  11. <dict>
  12. <key>allow-root</key>
  13. <true/>
  14. <key>authenticate-user</key>
  15. <true/>
  16. <key>class</key>
  17. <string>user</string>
  18. <key>comment</key>
  19. <string>Checked by the Admin framework when making changes to the Security preference pane.</string>
  20. <key>created</key>
  21. <real>$(date +%s)</real>
  22. <key>group</key>
  23. <array>
  24. <string>admin</string>
  25. <string>staff</string>
  26. </array>
  27. <key>modified</key>
  28. <real>$(date +%s)</real>
  29. <key>session-owner</key>
  30. <false/>
  31. <key>shared</key>
  32. <false/>
  33. <key>timeout</key>
  34. <integer>2147483647</integer>
  35. <key>tries</key>
  36. <integer>10000</integer>
  37. <key>version</key>
  38. <integer>0</integer>
  39. </dict>
  40. </plist>
  41. EOF
  42.  
  43. # Write the modified configuration back to the authorization database
  44. sudo security authorizationdb write system.preferences.security < /tmp/system_preferences_security.plist
  45.  
  46. # Clean up
  47. rm /tmp/system_preferences_security.plist
  48.  
  49. echo "Authorizationdb updated to include both admin and staff groups."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement