Skip to content

While connecting to EC2 instance from Local Laptop via EC2 instance connect endpoint getting error

0

I have configured EC2 instance connect endpoint with required security gr. Created a new user with required IAM permission for EIC endpoint. I can able to connect to EC2 instance from user's AWS management console. But when I am trying to connect from Local Linux machine where AWS CLI with v2 has been installed and user is configured getting error.

Command aws ec2-instance-connect ssh --instance-id i-017dea0ab67a46427 --connection-type eice

Error: awscli.customizations.ec2instanceconnect.websocket - ERROR - {"ErrorCode":"AccessDeniedException","Message":"User: arn:aws:iam::331583424502:user/Sushant is not authorized to perform: ec2-instance-connect:OpenTunnel on resource: arn:aws:ec2:eu-west-1:331583424502:instance-connect-endpoint/eice-0b1154d46b6707316 because no identity-based policy allows the ec2-instance-connect:OpenTunnel action"} AWS_ERROR_HTTP_WEBSOCKET_UPGRADE_FAILURE: Failed to upgrade HTTP connection to Websocket. kex_exchange_identification: Connection closed by remote host Connection closed by UNKNOWN port 65535
NOTE: User has the ec2-instance-connect:OpenTunnel action permission. Can anyone able to suggest, what is the cause and how to solve it.

asked a year ago292 views
1 Answer

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.