Working With Bastion Host
- In last Lab, we made the private subnet which is completely isolated now, to manage the private EC2 instance we would need Jump Server or Bastion Host in public
- We would first login to public EC2 and then take SSH of private EC2 instance
- We would need make sure Private-1B-SG has port 22 or SSH allowed for Public-1A-SG
- Now, login to Public EC2 and make sure .pem is copied to this instance, since this would be need to SSH into private EC2
- You can upload pem to S3 bucket make it publicly accessible and do a wget in your public EC2
wget https://S3-PEM-FILE-URL
- After downloading you would need to give pem file proper permission
chmod 400 FILENAME.pem
then do SSH
ssh -i FILENAME.pem ec2-user@PRIVATEIP
- Dont close the SSH session or delete the EC2 instances as we will need in next lab
- Similarly, we can try Bastion host for Windows EC2 as well