Ubuntu Server Baseline¶
This page prepares a fresh Ubuntu Server for course labs. It follows the same basic direction as DigitalOcean's Initial Server Setup with Ubuntu: create a non-root user, enable sudo, configure SSH access, and turn on a firewall safely.
Goal
Finish with a non-root administrative account, working SSH access, updated packages, and a basic firewall that allows SSH.
1. Confirm the Server Version¶
Recommended: Ubuntu 22.04 LTS or Ubuntu 24.04 LTS.
2. Update Packages¶
If this is a brand-new server and you are logged in as root, omit sudo until you create the regular user.
3. Create a Non-Root User¶
Replace student with your username:
Verify the user is in the sudo group:
Expected: the output includes sudo.
4. Test the New User¶
Open a second terminal and connect as the new user:
Then test administrative access:
Expected output:
Keep the original session open
Do not close the root or existing working session until the new user can log in and run sudo.
5. Install Core Utilities¶
These tools support later setup pages and common lab workflows.
6. Enable a Basic Firewall¶
Allow SSH first:
Enable UFW:
Check status:
Expected: OpenSSH is allowed and the firewall status is active.
Avoid lockout
If you use a custom SSH port, allow that port before enabling UFW. Example: sudo ufw allow 2222/tcp.
7. Set the Time Zone Optional¶
List time zones:
Set a time zone:
Verify:
8. Classroom Checkpoint¶
Record these outputs:
Troubleshooting¶
| Problem | Check |
|---|---|
sudo: command not found | Confirm you are on Ubuntu Server and install sudo as root. |
| User cannot run sudo | Run usermod -aG sudo USERNAME as root, then log out/in. |
| SSH stops working after firewall changes | Use the provider console and allow OpenSSH or the custom SSH port. |
Next Step¶
Continue to SSH and Terminal Workflow.