diff --git a/docs/deployment/aws-ec2-key-pairs.png b/docs/deployment/aws-ec2-key-pairs.png new file mode 100644 index 0000000..54c2be9 Binary files /dev/null and b/docs/deployment/aws-ec2-key-pairs.png differ diff --git a/docs/deployment/aws-instance-connect-terminal.png b/docs/deployment/aws-instance-connect-terminal.png new file mode 100644 index 0000000..e4e2f3e Binary files /dev/null and b/docs/deployment/aws-instance-connect-terminal.png differ diff --git a/docs/deployment/cli-public-key.png b/docs/deployment/cli-public-key.png new file mode 100644 index 0000000..6b355c0 Binary files /dev/null and b/docs/deployment/cli-public-key.png differ diff --git a/docs/deployment/connect_to_EC2.md b/docs/deployment/connect_to_EC2.md new file mode 100644 index 0000000..132b1d3 --- /dev/null +++ b/docs/deployment/connect_to_EC2.md @@ -0,0 +1,40 @@ + + +# How to create the SSH key pair + +## Create the key pair +Go into key pairs in the EC2 dashboard and create a new key pair. Download the .pem file and save it in the root of the project. + +![KeyPairs GUI](aws-ec2-key-pairs.png) +Will automatically download a Private key +![create-key-pair GUI](create-key-pair.png) +Connect to the instance through AWS Instance Connect +Now to connect key pairs to the EC2 instance, we need to add the Public key +Write this and get the public key +```bash +ssh-keygen -y -f /path_to_downloaded_key-pair.pem +``` +You will get a public key like this: +![public-key GUI](cli-public-key.png) + + +```bash +sudo nano .ssh/authorized_keys +``` +Now we need to add the public key into the EC2 instance, which we got running on the website through the AWS Instance connect terminal + +![AWS Instance connect terminal](aws-instance-connect-terminal.png) + +Now we need to reboot the EC2 Instance: +![reboot GUI](reboot-ec2.png) + +## Connect to the EC2 instance +We now need the private key to connect, so write this in your terminal +```bash +chmod 400 /path_to_downloaded_key-pair.pem +``` + +You can now connect to the Ubuntu instance, by writing this: +```bash +ssh -i "/path_to_downloaded_key-pair.pem" ubuntu@ec2-16-171-88-123.eu-north-1.compute.amazonaws.com +``` diff --git a/docs/deployment/create-key-pair.png b/docs/deployment/create-key-pair.png new file mode 100644 index 0000000..b348411 Binary files /dev/null and b/docs/deployment/create-key-pair.png differ diff --git a/docs/deployment/reboot-ec2.png b/docs/deployment/reboot-ec2.png new file mode 100644 index 0000000..f06de58 Binary files /dev/null and b/docs/deployment/reboot-ec2.png differ