2回答
- 新しい順
- 投票が多い順
- コメントが多い順
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公式更新しました 9ヶ月前
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.
Here my ec2 instance have only private IP address. So using ec2 instance connect endpoint method. AWS CLI with latest version is already in place. Forgot to mentioned one point, the connection to ec2 instance from user's AWS management console is working fine. But when trying from AWS CLI getting the error.
I tried with command AWS CLI command
ssh -i EC2-test-eu-west.pem ubuntu@i-017dea0ab67a46427 -o ProxyCommand='aws ec2-instance-connect open-tunnel --instance-id i-017dea0ab67a46427 --max-tunnel-duration 3600'
It worked.
But when trying with ssh command only with instance ID
aws ec2-instance-connect ssh --instance-id i-017dea0ab67a46427 --connection-type eice
2024-09-04 04:52:22,417 - 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