Search code examples
amazon-web-servicesamazon-ec2sshaws-ssmaccess-keys

AWS SSM encounter an error 403 upon using session manager CLI plugin


What's wrong with my configuration? I'm getting this error message upon accessing my AWS Instance on my local ubuntu using AWS SSM or Session Manager Plugin for AWS CLI.

enter image description here

enter image description here

enter image description here

I want to access my AWS EC2 Instance on my local ubuntu machine.

Were not allowed to use pemfile for security reason.


Solution

  • I recognize your screenshot as part of the SSO account selection webpage.

    Since you're using SSO, you must specify session token. aws configure does not prompt for it. So that command will not be sufficient for configuration - which is why it's not in the instructions.

    Setting key, secret, and session token every time you SSO in is quite a pain. I would strongly recommend doing this instead: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html

    That works with aWS CLI v2 as well as just about every SDK. I use it every day.