- Newest
- Most votes
- Most comments
Hello.
Are AWS CLI and Session Manager Plugin installed on the PC you are connecting from?
If it is not installed, please install it by following the steps in the document below.
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html
Once installed, set the IAM user access key.
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html
After setting the access key, use the following command to check if you can connect to EC2 via Session Manager.
aws ssm start-session --target "EC2 Instance ID" --region us-east-1
When combining with VSCode Remote SSH, please configure the following settings in "~/.ssh/config".
I think the following GitHub issues will be helpful.
https://github.com/aws/aws-toolkit-vscode/issues/941
# SSH to remote VS Code instance
host my-vscode-remote
HostName "EC2 Instance ID"
Port 22
User ec2-user
IdentityFile "EC2 Keypair file path"
ProxyCommand aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'
Additionally, EC2 must be registered as a Systems Manager managed instance by setting an IAM role.
https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-setting-up-ec2.html
Relevant content
- asked 5 months ago
- Accepted Answerasked 5 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Hey @Riku_Kobayashi, I want to avoid the creation of any key OR use any existing key. Is there any other way of achieving this?