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.