If you don't have a local Ubuntu machine, follow these steps to launch one on AWS EC2:
- Go to the AWS EC2 Console and click Launch Instance.
- Enter a name for your instance.
- Under Application and OS Images, select Ubuntu and choose Ubuntu Server 22.04 LTS as the AMI.
- Under Instance type, select
t2.microort3.micro. - Under Key pair, click Create new key pair. Name it, keep the defaults (RSA, .pem), and click Create key pair. The
.pemfile will download automatically — save it to~/.ssh/. - Under Network settings, ensure Allow SSH traffic is checked and set the source to My IP.
- Click Launch Instance.
- Once the instance is running, copy the Public IPv4 address from the instance details page.
- Set permissions on your key file and connect via SSH:
chmod 400 ~/.ssh/
ssh -i ~/.ssh/<your-key.pem> ubuntu@<your-public-ip>
- Once connected, get root access:
sudo su