Problems connecting to EC2 instance using EC2 instance connect endpoint

0

I followed this guide (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/permissions-for-ec2-instance-connect-endpoint.html). I can connect to the instance using the console but can't connect using AWS CLI. This is the output I get.

aws ec2-instance-connect ssh --instance-id i-0daa56a4c6ce5578d

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run:

aws help aws <command> help aws <command> <subcommand> help

aws: error: argument operation: Invalid choice, valid choices are:

send-ssh-public-key | send-serial-console-ssh-public-key help

When I use the valid choices provided above, this is what I get

aws ec2-instance-connect send-ssh-public-key --instance-id i-0daa56a4c6ce5578d --availability-zone us-east-1a --instance-os-user ec2-user --ssh-public-key file://my_key.pub { "RequestId": "fa460a07-0df4-4886-bcc0-7eaf808f3cf6", "Success": true }

Where should I go from here?

Edy
已提問 1 年前檢視次數 1178 次
2 個答案
1
已接受的答案

Make sure you have the latest version of the AWS CLI.

profile pictureAWS
專家
kentrad
已回答 1 年前
profile picture
專家
已審閱 1 年前
profile picture
專家
已審閱 1 年前
0

Have you followed instructions here : https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-methods.html

After pushing the key, you need to use ssh to connect to your instance.

AWS
專家
已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南