I found a reproducible case of this same error while using aws-vault over a remote SSH session into a MacBook:
ssh mymacbook.local
aws-vault exec ${AWS_CONFIG_PROFILE_NAME_HERE} -- ${SOME_AWS_COMMAND_HERE}
This opens a local browser page to AWS SSO auth. I'm able to use VNC to remotely connect to the active display and click to approve the session in the browser window.
Then the command returns the following error:
Opening the SSO authorization page in your default browser (use Ctrl-C to abort)
https://device.sso.us-east-1.amazonaws.com/?user_code=XXXX-XXXX
aws-vault: error: exec: Failed to get credentials for ${AWS_CONFIG_PROFILE_NAME_HERE}: User interaction is not allowed. (-25308)
This same command works perfectly fine when run locally & directly using the MacBook's keyboard & screen. The -25308 error code and message are 100% reproducible when trying this command over a remotely connected SSH terminal session.
I have checked that the login keychain is shown as unlocked in the Keychain Access app. I've also tried running: security unlock-keychain "${HOME}/Library/Keychains/login.keychain-db" in the remote SSH terminal.
Seems like this may have something to do with some other hidden macOS security settings that prevent aws-vault (or other apps, such as the VPN app the OP mentions), from working over a remotely started terminal session?
Topic:
Privacy & Security
SubTopic:
General
Tags: