Security command: User interaction is not allowed!

adam_vu
New Contributor III

Hey guys,
I'm need to run security show-keychain-info command to query Keychains information of endpoints. Some of them return User interaction is not allowed although their Keychain is unlocked.
Other security commands don't work on those endpoints.
How can I fix this now?

1 ACCEPTED SOLUTION

adam_vu
New Contributor III

I figured it out. Have to use

currUser=$(/usr/bin/stat -f%Su /dev/console) currUserUID=$(id -u "$currUser") /bin/launchctl asuser "$currUserUID" sudo -iu "$currUser" /usr/bin/security

View solution in original post

1 REPLY 1

adam_vu
New Contributor III

I figured it out. Have to use

currUser=$(/usr/bin/stat -f%Su /dev/console) currUserUID=$(id -u "$currUser") /bin/launchctl asuser "$currUserUID" sudo -iu "$currUser" /usr/bin/security