Skip to content
BoKSA

03 – Operating Systems, Networks and Linux Basics

03 – Operating Systems, Networks and Linux Basics

Course: ICT Basic course · Level: introductory Book: Kurose & Ross, 9th ed., chapter 2 (intro: network applications and the OS); for OS background: Stallings, Operating Systems, or the free book Operating Systems: Three Easy Pieces

Learning goals

After this article you can:

  • explain what an operating system (OS) does and why different devices use different OSes;
  • explain which parts of the network stack live in the application, the OS kernel and the hardware;
  • set up a Linux virtual machine (or WSL) to practise with;
  • use basic Linux commands for files, users, permissions, processes and networking;
  • use the modern network commands (ip, ss, dig, curl) and recognise the older ones (ifconfig, netstat).

1. What is an operating system?

An OS is software that manages the hardware of a system (CPU, memory, storage, network interface, display...) and offers services to programs and users. (after Stallings)

Main tasks of an OS:

Task Example
Process management run many programs at the same time (scheduling)
Memory management give each program its own protected memory space
File systems store data in files and folders (ext4, NTFS, APFS)
Device drivers talk to hardware such as the network card
Networking implements TCP/IP, offers sockets to applications
Security users, permissions, isolation between programs

Many OSes, each for its own job

Device Typical OS
Desktop/laptop Windows 11, macOS, Linux (Ubuntu, Fedora, Debian)
Server / cloud Linux (the large majority of servers and cloud instances), Windows Server
Phone Android (Linux kernel), iOS
Router / switch Cisco IOS-XE, Juniper Junos, Arista EOS, MikroTik RouterOS, OpenWrt (Linux)
Embedded / IoT Linux (Raspberry Pi OS), FreeRTOS, Zephyr
Containers Linux (Docker, Kubernetes)

So: "the best OS" doesn't exist. It depends on what you need. Every ICT professional needs to be comfortable with Linux, because almost every server, cloud service and network device uses it or something similar.


2. Where does the network stack live?

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
┌───────────────────────────────────────────┐
│ Application layer    → your program       │  user space (written by software developers)
│     (browser, web server, game)           │
├─────────── socket API ────────────────────┤
│ Transport layer (TCP/UDP)                 │  OS kernel
│ Network layer (IP)                        │
├───────────────────────────────────────────┤
│ Link layer  (driver + network card / NIC) │  driver + hardware
│ Physical layer (cable, radio)             │
└───────────────────────────────────────────┘
  • A socket is the "door" between an application and the transport layer. A programmer opens a socket and says "send these bytes to IP x, port y". The OS handles the rest.
  • Network-core devices (routers) only implement layers 1–3. They don't run user applications.
  • Modern exceptions: QUIC (HTTP/3) implements its transport functions in user space, on top of UDP. Smart NICs and eBPF/XDP in Linux process packets very fast, close to the hardware.

3. Your practice environment

To practise with Linux and networking safely, use a 64-bit Linux virtual machine or WSL. (32-bit Linux images are outdated: most modern software no longer supports them.) Choose one of these options:

Your laptop Recommended setup
Windows 10/11 WSL2 with Debian or Ubuntu (wsl --install -d Debian), or VirtualBox 7 with a Debian 13 64-bit VM
macOS with Apple Silicon (M1–M4) UTM (free) with Debian 13 ARM64, or VirtualBox 7.1+ (supports Apple Silicon)
macOS Intel VirtualBox 7 with Debian 13 64-bit
Linux You're already there. Or use a VM to experiment safely
  • Debian 13 "trixie" is the current stable release (first released August 2025; supported until 2028, LTS until 2030).
  • Install Wireshark on your host laptop (Windows/macOS/Linux) for the capture exercises.

Tip: take a snapshot of your VM before you start experimenting. If you break something, you can go back.


4. Linux basics

4.1 Logging in and the shell

You type commands in a shell (usually bash or zsh). The prompt shows who and where you are:

1
2
student@debian:~$        ← normal user, in home directory (~)
root@debian:/etc#        ← root (administrator), in /etc

When you type a password, nothing appears on the screen. That's a security feature, not a bug.

Root vs. sudo: don't log in as root. Work as a normal user and use sudo for administrator tasks. This limits the damage from mistakes and malware.

4.2 Files and directories

Command Meaning
pwd show the current directory
ls -la list files, including hidden files and permissions
cd /etc · cd .. · cd ~ change directory
mkdir practice create a directory
cp a b · mv a b · rm a copy, move/rename, delete (no recycle bin!)
cat file · less file show a file
nano file simple text editor (or vim if you're brave)
grep word file search for text
man ls · ls --help help

Important directories: /etc (configuration), /home (users), /var/log (log files), /usr/bin (programs), /tmp (temporary).

4.3 Users and permissions (rwx)

1
2
3
4
5
6
7
$ ls -l script.sh
-rwxr-x---  1 student staff  512 Oct 15 10:00 script.sh
 │└┬┘└┬┘└┬┘
 │ │  │  └── others: no rights
 │ │  └───── group (staff): read + execute
 │ └──────── owner (student): read + write + execute
 └────────── - = file, d = directory
Letter File Directory Value
r read list contents 4
w write create/delete files 2
x execute enter (cd) 1
1
2
3
chmod 750 script.sh      # rwx r-x ---
chmod u+x script.sh      # give the owner execute permission
chown student:staff file # change owner and group

4.4 Packages, services and logs

1
2
3
4
5
6
7
sudo apt update && sudo apt upgrade     # update the package list and install updates
sudo apt install curl dnsutils          # install software
systemctl status ssh                    # status of a service
sudo systemctl restart ssh              # restart a service
journalctl -u ssh --since today         # logs of a service
ps aux | grep nginx                     # running processes
top   (or htop)                         # live overview of CPU/memory

4.5 Network commands – modern and legacy

Task Modern (use these) Legacy (still found on older systems, macOS, books)
Show interfaces and IP addresses ip a (or ip addr) ifconfig
Show routing table ip r route -n, netstat -r
Show neighbours (ARP/NDP cache) ip neigh arp -a
Show open ports / connections ss -tulpn netstat -tulpn
Test reachability ping, ping -6 —
Path to destination traceroute, tracepath, mtr —
DNS lookup dig, host, resolvectl query nslookup (still widely used, also on Windows)
HTTP request curl -v https://... telnet host 80
Raw TCP/UDP connection nc (netcat), openssl s_client (for TLS) telnet

Why changed? ifconfig, netstat, route and arp come from the old net-tools package. It is no longer maintained on Linux and is not installed by default on Debian. The iproute2 tools (ip, ss) replaced them. On macOS and BSD, ifconfig and netstat are still the standard tools. Windows uses ipconfig /all, route print, arp -a, netstat -ano, nslookup, tracert, Test-NetConnection (PowerShell).

Example:

1
2
3
4
5
6
7
8
$ ip a
1: lo: <LOOPBACK,UP> ...
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
2: enp0s3: <BROADCAST,MULTICAST,UP> ...
    link/ether 08:00:27:3a:5c:11 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
    inet6 fe80::a00:27ff:fe3a:5c11/64 scope link
  • lo = loopback interface (127.0.0.1 / ::1): the machine talking to itself.
  • enp0s3 = the network card, with a MAC address (link/ether), an IPv4 address (inet) and an IPv6 link-local address (inet6 fe80::).

5. Try it yourself

  1. Install your practice environment (section 3) and take a snapshot.
  2. Run ip a, ip r and ss -tulpn. What is your IP address? What is your default gateway? Which ports are open?
  3. ping -c 4 1.1.1.1 and ping -c 4 www.hva.nl. If the first works and the second doesn't, what is probably wrong?
  4. Create a file secret.txt that only you can read and write (chmod 600). Check it with ls -l.
  5. Play the OverTheWire Bandit game (levels 0–10): https://overthewire.org/wargames/bandit/

Check your understanding

  1. Name four tasks of an operating system.
  2. Which layers of the network stack are implemented in the OS kernel?
  3. What is a socket?
  4. What do the permissions rw-r----- mean?
  5. Which modern command replaces ifconfig? And netstat?

References

Book and courses

Videos

Tools


Cyber Security

Why is this important for cyber security?

  • The OS is the foundation of security. It decides which user may read which file, which program may use the network, and which memory belongs to whom. If the OS is compromised (e.g. a rootkit), nothing on that machine can be trusted any more.
  • Unpatched systems are the number one way in. Attackers scan the whole Internet for known vulnerabilities within hours of their publication. A system that is not updated will be found.
  • Too many rights = big damage. Malware or an attacker running as root/Administrator can do anything. Running as a normal user limits the damage (principle of least privilege).
  • Open ports = attack surface. Every service listening on the network (ss -tulpn) is a possible entry point.
  • Logs are evidence. Without logs (/var/log, journalctl) you cannot detect or investigate an incident.

What can you do to make it safe?

  • Update automatically: sudo apt install unattended-upgrades on Debian; enable Windows Update / macOS updates.
  • Use least privilege: work as a normal user, use sudo only when needed, give files the minimum permissions (chmod 600 for private keys and secrets).
  • Use strong authentication: long passphrases, and for SSH use keys instead of passwords (ssh-keygen -t ed25519). Disable root login over SSH (PermitRootLogin no).
  • Close what you don't use: remove or disable unused services and check with ss -tulpn.
  • Use a host firewall: nftables or ufw on Linux (sudo ufw enable), Windows Defender Firewall.
  • Download software only from trusted sources (official repositories, verified checksums/signatures). This also applies to VM images!
  • Snapshots and backups let you recover from mistakes and ransomware.

Extra references