#!/bin/bash
sudo yum update -y
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
sudo chown -R $USER:$USER /var/www
echo "<h1>Hello World from $(hostname -f)</h1>" > /var/www/html/index.html
ssh -i {Private key} ec2-user@{Your Public IP}
chmod 0400 {Private Key} # UNPROTECTED PRIVATE KEY FILE 에러가 뜰 때 실행