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
질문됨 일 년 전1179회 조회
2개 답변
1
수락된 답변

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

profile pictureAWS
전문가
kentrad
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전
profile picture
전문가
검토됨 일 년 전
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
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠