Most web servers, cloud machines and company infrastructure run Linux, and usually without a desktop. In this lesson you'll build one: Ubuntu Server 26.04 LTS, managed entirely from the command line and over SSH, exactly how real admins work. It becomes your Linux target for scanning, brute-force and hardening practice.
Download
Go to ubuntu.com/download/server and choose Option 2: Manual server installation to get the ISO. LTS means Long Term Support: five years of security updates, which is why companies run it.
Create the VM
- New → Name ubuntu-srv, select the ISO, Type Linux, Version Ubuntu (64-bit), tick Skip Unattended Installation.
- Hardware: 2048 MB RAM, 2 CPUs.
- Hard disk: 25 GB, VDI, dynamically allocated.
- Settings → Network: Adapter 1 NAT, Adapter 2 Host-only (LabNet).
Walk through the installer
The server installer is text-based. Use arrow keys, Tab, Space to tick and Enter to confirm.
| Screen | What to choose |
|---|---|
| Language & keyboard | English, your layout |
| Type of installation | Ubuntu Server (not minimized) |
| Network | You'll see two adapters: enp0s3 10.0.2.15 (NAT) and enp0s8 192.168.56.1xx (LabNet). Leave both on DHCP for now |
| Proxy & mirror | Leave as they are |
| Storage | Use an entire disk, keep Set up this disk as an LVM group → Done → Continue |
| Profile | Your name, server name ubuntu-srv, username, password |
| Ubuntu Pro | Skip for now |
| SSH | ✔ Install OpenSSH server. This is the important one |
| Featured snaps | Don't select any |
When it says Installation complete, choose Reboot now. If it asks you to remove the installation medium, just press Enter.
First login
sudo apt update && sudo apt full-upgrade -y
ip -br a # note the names: usually enp0s3 (NAT) and enp0s8 (LabNet)
df -h / # how big is your root filesystem?
LVM gotcha: the installer often gives / only part of the disk. If
df -h /shows much less than 25 GB, give it the rest:sudo lvextend -r -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
Give it a static IP with Netplan
Servers need addresses that never change. Ubuntu configures networking with Netplan YAML files in /etc/netplan/. Create a new file just for LabNet:
sudo nano /etc/netplan/60-labnet.yaml
network:
version: 2
ethernets:
enp0s8:
dhcp4: false
addresses:
- 192.168.56.20/24
YAML is strict about spaces. Use spaces, never tabs, and keep the indentation exactly as shown.
Lock down the file's permissions, then apply it safely:
sudo chmod 600 /etc/netplan/60-labnet.yaml
sudo netplan try # applies it; press Enter to keep it, or it rolls back after 120 s
ip -br a # enp0s8 should now show 192.168.56.20/24
netplan try is a habit worth learning. On a remote server, a typo in the network config can lock you out, and try undoes it automatically.
Work like an admin: SSH in from Kali
Power the server off, then start it with Start → Headless start (no window, less RAM). From now on you manage it over SSH:
# On Kali
ping -c 3 192.168.56.20
ssh yourname@192.168.56.20
You can also SSH from your own PC, because the host is on LabNet too (192.168.56.1).
Turn it into a target
Add a web server, so there's more to discover:
sudo apt install -y apache2
Now scan it from Kali, the way an attacker would:
nmap -sV -p- 192.168.56.20
You should find 22/tcp OpenSSH and 80/tcp Apache httpd. Open http://192.168.56.20 in Kali's browser to see the Apache default page.
See the defender's side
From Kali, try to SSH in with a wrong password three times. Then on the server:
sudo journalctl -u ssh --since "10 min ago" | grep -i failed
You'll see each failed login and the IP it came from (Kali). That's exactly what a SOC analyst looks for when hunting brute-force attacks. Take a snapshot called clean-install when you're done.