1

Trying to connect to Ubuntu machine in AWS from web browser. enter image description here

Got error:

There was a problem setting up the instance connection
Log in failed. If this instance has just started up, try again in a minute or two.

enter image description here

This machine runs for half an hour. Why I can't connect? Connection from putty works fine.

vico
  • 813
  • You're a genius! I've never come up with the idea of trying it with Putty, because I assumed there was no point in trying to do so because if it doesn't work with the default client which is provided by AWS itself, the likelihood that it's gonna work with Putty is so much smaller! – Arturas M Dec 11 '19 at 22:47

2 Answers2

1
  1. Connect the AWS server with A standalone SSH client, ssh into the server.
  2. install ec2-instance-connect package on Ubuntu. eg. apt-get install ec2-instance-connect.

Next time, you can use the browser-based SSH connection.

Justin
  • 111
1

To elaborate on the previous answer: Yes, installing ec2-instance-connect on Ubuntu does help. For using the browser based SSH client, keys need to be configured properly – and this is is exactly what this package does. Here's the description from the package:

Description: Configures ssh daemon to accept EC2 Instance Connect ssh keys
 EC2 Instance Connect is a service that publishes ssh keys for use by EC2
 instances based on AWS Credentials. These keys are consumed by on-instance
 configuration provided by this package. The ssh daemon will query EC2
 Instance Metadata service for user-keys at ssh calltime, validate any if
 present as well as validating their signature, and if all checks pass return
 will include them in the authorized keys list.
 .
 In addition, there is an agent that harvests instance ssh host keys and
 passes them back to the service.  This is for authentication purposes by
 the EC2 console to open an in-browser ssh terminal connection.