We can run Ubuntu server on AWS EC2 with public IP address.
Version
Ubuntu 20.04
EC2
Instances
: selectinstances
on the left menuLaunch Instances
: build new Linux server
Ubuntu
Free tier only
: selectFree tier only
to show only free images on the leftUbuntu Server 20.04 LTS
: build new Linux Server byUbuntu Server 20.04 LTS
Instance Type
- Select
t2.micro
for free - Click
Review and Launch
to accept default configuration and launch server directly
Review Instance Launch
- We are warned that default security group may be accessible from any IP address. For better security concerns, it would be better to only allow access from known IP address only
- If we want to use other port (e.g. HTTP (80)), we have to open that port manually
Key Pair
- Select existing key pair
- Click
Launch Instances
to run server
Launch Status
Run Linux server successfully.
Instance Summary
We can get public IP of Linux server on Public IPv4 address
section.
SSH
$ ssh -i MyEC2.pem ubuntu@18.176.57.41
Use SSH to connect to Linux server :
-i
: specify the location of pemubuntu
: the user for Ubuntu server@
: public IP address of Ubuntu server
Type yes
if we connect to Linux server first time.
Conclusion
- We may encounter SSH connection error if we just use downloaded pem, try
chmod 400 myEC2.pem
to change permission