Open emilyllim opened 1 year ago
Changes related to this issue are committed to pull request #7
In an attempt to SSH into the instance provisioned by Terraform, I discovered that additional information must be added to the Terraform configuration file.
ISSUE: I could not SSH into the instance because there was no associated key pair created when the instance was provisioned
terraform apply
again, there is no longer a warning from the console about no associated key pair, but I am still unable to SSH to the instance.ERROR MESSAGE:
sign_and_send_pubkey: no mutual signature supported
[instance-user-name@instance-public-dns-name]: Permission denied (publickey).
To address this issue of being unable to SSH to the instance, I tried these steps:
config
file within the .ssh
directory in my machine with the following contents:
Host *
PubkeyAcceptedKeyTypes=+ssh-rsa
HostKeyAlgorithms=+ssh-rsa
Unfortunately, it seems that this method is not recommended for security reasons, so as a better approach, I added a new key pair using ed25519
instead of rsa
[instance-user-name@instance-public-dns-name]: Permission denied (publickey).
The next thing I tried to do was update the Terraform configuration file:
aws_instance
resource, I defined it as a separate aws_key_pair
resource.terraform apply
, attempting to SSH into the instance still results in the same errors.I went back to the previous (deprecated?) method of creating an rsa
key pair, and adding the previous rsa
config, and then running terraform apply
. SSH'ing still works this way.
Overview
This issue will include an overview of how to use GitHub Actions to automate provisioning an AWS EC2 instance using Terraform.
Resources