layout |
---|
default |
-
By using GUI ("Keychain-Access")
- Select File->New Password Item (cmd+N)
- Make sure Keychain item name is distinct —>
service-name
in command line - Account name —>
USER
in command line, it is$whoami, or echo $ {USER}
-
Command line using security command
- Help:
security add-generic-password -h
-
Add command:
add-generic-password$ security add-generic-password -a ${USER} -s <service-name> -w
Enter password on prompt,
-
Update password if already exists :
-U
flag$ security add-generic-password -a ${USER} -s <service-name> -w -U
-
Delete password:
security delete-generic-password -h
security delete-generic-password -a ${USER} -s <service-name>
-
Retrieve Password:
security find-generic-password -h