How to connect VSCode to an EC2 with SSM?

0

Hey,

I followed this tuto to the letter to connect my Mac Laptop running VSCode to an EC2 (tried both AL2 and Ubuntu) through an AWS SSO-managed SSM session https://repost.aws/articles/AR8Gk1UngsTpmpu7azMUiNvw/how-to-connect-to-a-private-ec2-instance-from-a-local-visual-studio-code-ide-with-session-manager-and-aws-sso-cli and I get a

Could not establish connection to "i-xxxxxxxxxx": Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Note that from my Terminal I can aws ssm start-session fine to the same instance... what is wrong?

  • Hi, Olivier! Do you use SSO and are you also able to run aws sso login command from the Terminal?

  • @Ivan yes, aws sso login from my Mac Terminal works fine

  • And does it open browser session when you type ssh instance_id? I recommend to add the flag -v to ssh to see a little bit more information about the output of the commands, there should be some log lines about banners, i. e.: ssh -v instance_id

1 Antwort
0
AWS
vtjean
beantwortet vor 3 Monaten
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen