I have tha solution of this why ec2 instance is gives this error. You can simply go to the directory where your .Pem file is stored. and run command "chmod 400 <pemfile>" by giving these permission you can able to connect to your ec2 by ssh.
Another point to add regarding issues with EC2 Instance Connect via AWS Management Console.
If you receive the following error when trying to connect to the instance:
Then it is likely that your Security Group was not properly configured.
EC2 Instance Connect uses specific IP address ranges for browser-based SSH connections to your instance (when users use the Amazon EC2 console to connect to an instance). If your users will use the Amazon EC2 console to connect to an instance, ensure that the security group associated with your instance allows inbound SSH traffic from the IP address range for EC2_INSTANCE_CONNECT. To identify the address range, download the JSON file provided by AWS and filter for the subset for EC2 Instance Connect, using EC2_INSTANCE_CONNECT as the service value. These IP address ranges differ between AWS Regions. For more information about downloading the JSON file and filtering by service, see AWS IP address ranges in the Amazon VPC User Guide.
To look for AWS IP address ranges for each service in each region, use the following JSON file available at https://ip-ranges.amazonaws.com/ip-ranges.json
For example, IP address range for the EC2 instance connect service at the us-east-1 region is:
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
Is there a youTube video or a training video that help with this? I am new to the entire AWS environment and it is not very newbie friendly with the navigation and menus. Been trying all the different options people recommended and now I think my account is a mess.
you can learn the process from following youtube link https://www.youtube.com/watch?v=rtG8S5WsSHg&t=26s
if you are new aws I would suggest attending the course from https://www.udemy.com/ .
for ec2 issue, Please check port 22 from security group
Hi, What's your error? Have you configured your SSH connections ?
- Ensure that the security group attached to your instance allows access to port 22 for Linux and port 3389 for Windows.
- Verify that your network access control list (network ACL) permits access to the instance.
- Confirm that your route table has a route for the connection these are some solutions i can recommend you this video will help you https://www.youtube.com/watch?v=rtG8S5WsSHg&t=26s
Relevant content
- asked a year ago
- Accepted Answerasked 2 years ago
- asked 2 years ago
- asked a year ago
- asked 24 days ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 20 days ago
- AWS OFFICIALUpdated a year ago