I am on OSX and using my terminal to access my Keychain Access. So I use this command

security find-internet-password -a myaccount -s myservice -g

and it works correctly but before I can get the response to this query, there is a pop-up showing and telling me that security wants to use confidential data kept in the Keychain... (translated from french). Why is it so? How can I desactivate it?

Btw, I tried to ssh to my own computer, in order to prevent the popup to show, but then I got no output when I ran the same command...


You can deactivate the message by adding security to the list of applications allowed to access the entry inside Keychain Access.app:

enter image description here

You can also add an allowed application to an already existing item using the CLI (you will get a GUI box asking for confirmation though):

security add-generic-password -a ${USER} -s playground -T /usr/bin/security -U

-T is the path of the application you want to authorize and -U is to update entry if it already exists (what's called an "upsert" in some databases). (and playground is the name of my test entry).

See man security (or the online version) for further reference.

  • 1
    Is it possible to make security ask for Touch ID verification on every call to find-generic-password for a specific entry? – neu242 Mar 18 '20 at 7:47

This is to protect your keychain from being accessed by a malicious script that might try to read it and mail it elsewhere.

If you say OK to the message it will not ask again (usually) so you only have to give it permission the first time.

  • Unfortunately, I can only get it to show the encrypted password. That's probably a good thing, but is there a way of getting it to show it? – Benjamin R Sep 26 '17 at 6:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .