How to set default keychain via cli in mac?

Viewed 2115

I got this error after deleting the default keychain expecting that MacOS will pick the available one as default but it did not.

security: cert import failed: A default keychain could not be found. security: problem decoding

I want to set the default keychain using cli

1 Answers
security default-keychain -s "/Users/ted/Library/Keychains/login.keychain-db"

Found it in

man security
Related