Friday, October 2, 2020

MacOS Keychain Command Line

 # add a password
security add-generic-password -a {Account} -s {Service} -w {Password}
# retrieve a password
security find-generic-password -a {Account} -s {Service} -w

example:
set smtp_pass = `security find-generic-password -a mailsync -s bob@example.com -w`

HT: TIL: macOS keychain command line - Rys Sommefeldt

No comments: