UnixDroid

Lesson 6 of 10 · 11 min

Install Ubuntu Server 26.04 as a Linux target

Install Ubuntu Server 26.04 LTS with SSH, give it a static LabNet IP with Netplan, and turn it into a Linux target you can scan and attack.

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.

Ubuntu Server VM recipe card
Ubuntu Server VM recipe card

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

  1. New → Name ubuntu-srv, select the ISO, Type Linux, Version Ubuntu (64-bit), tick Skip Unattended Installation.
  2. Hardware: 2048 MB RAM, 2 CPUs.
  3. Hard disk: 25 GB, VDI, dynamically allocated.
  4. 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.

ScreenWhat to choose
Language & keyboardEnglish, your layout
Type of installationUbuntu Server (not minimized)
NetworkYou'll see two adapters: enp0s3 10.0.2.15 (NAT) and enp0s8 192.168.56.1xx (LabNet). Leave both on DHCP for now
Proxy & mirrorLeave as they are
StorageUse an entire disk, keep Set up this disk as an LVM group → Done → Continue
ProfileYour name, server name ubuntu-srv, username, password
Ubuntu ProSkip for now
SSH✔ Install OpenSSH server. This is the important one
Featured snapsDon'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.

Try it yourself
  1. Install Ubuntu Server with OpenSSH enabled.
  2. Extend the root volume if df -h / shows unused space.
  3. Set 192.168.56.20/24 on enp0s8 with Netplan, using netplan try.
  4. Start the VM headless and SSH into it from Kali.
  5. Install Apache and run nmap -sV -p- 192.168.56.20 from Kali. Write down the open ports and versions.
  6. Fail an SSH login three times, then find the attempts with journalctl.
No Linux machine? Practise in the free online terminal

Quick check

Complete the command that applies a Netplan change but rolls it back automatically if you lose connection: sudo netplan ___

Need a hint?

It gives you 120 seconds to confirm.

Finished this lesson?

Done lessons keep your daily streak going 🔥

0 day streak

0 lessons done

best 0 days

Log in to keep your streak on every device →