The Linux server from an operator's seat

Beginner · 15 min

What a Linux server actually is when you have to run one: where config, logs and state live, who the users are, and the first commands to run on a box.

Before thisWhat DevOps is and the problem it solvesDevOps, SRE and platform engineering

Learn Linux TV · 15 min

The Linux server from an operator's seat

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by Learn Linux TVReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • A server is a Linux machine with no screen and no one sitting at it. You reach it over SSH and learn its state from files and commands, not from a desktop.
  • The filesystem layout is a map: configuration in /etc, logs and changing state under /var, installed programs under /usr, runtime files in /run.
  • Most accounts on a server are system users with a nologin shell. They exist so each service runs with its own limited permissions, not as root.
  • Software comes from the distribution's package manager, which knows every file it installed and can update or remove it cleanly.
  • The first look at an unfamiliar box answers four questions: what is it, is it healthy, what is running, and what has gone wrong recently.

The machine you never see

Your app runs on your laptop. You can see it, you can click on it, and when it breaks you notice. Production is different. The app runs on a machine in a data centre or a cloud region, shared with other programs, with no monitor and nobody nearby. You reach it over a network, type commands, and read what comes back. If the disk fills at 3 a.m., the only witness is a log file.

That is the operator’s seat. You do not need to know everything about Linux to sit in it, but you need a mental map of where things are and a short list of questions to ask. Everything else in this roadmap, from systemd to Kubernetes, runs on top of this machine.

The filesystem is a map

Linux puts things in predictable places, so an operator can find them on a box they have never seen. The convention is called the Filesystem Hierarchy Standard. The parts you touch most:

Path What lives there
/etc Configuration. nginx.conf, ssh/sshd_config, the list of users.
/var/log Logs written to files.
/var/lib State that programs keep: package databases, data directories.
/usr Installed programs and their libraries. Read-only in normal operation.
/run Files that only matter while the system is up, such as PID files.
/home, /root Users’ home directories.
/tmp Scratch space that can be wiped.

Think of it like a building’s floor plan. The fire exits are always in the same place relative to the stairs, so a firefighter does not need a tour. If you know a service’s config is under /etc and its data under /var/lib, you already know what to back up and what you can rebuild.

A real root filesystem, up close

I had no Linux server to log in to for this lesson, and this Mac is not Linux. So I fetched the real Debian 13 root filesystem that the official nginx image is built on, straight from Docker Hub’s registry API with curl, and unpacked its first layer into a scratch directory. It is a container base, not a full server, and I will come back to what that leaves out. But the layout is the real thing.

$ cat rootfs/etc/os-release | head -4
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
$ readlink rootfs/bin rootfs/sbin rootfs/lib
usr/bin
usr/sbin
usr/lib
$ grep -c '^Package:' rootfs/var/lib/dpkg/status
78

Three facts from that. /etc/os-release is the first file to read on any box, because it says which distribution you are on, and so which commands and package names apply. /bin is a symlink to usr/bin: Debian uses a merged /usr, so the old split between /bin and /usr/bin is gone. And the package manager’s own database, under /var/lib/dpkg, records 78 installed packages. Every file on the system that came from a package is accounted for there, which is why you install and update software with apt (or dnf on the Red Hat family) rather than by copying binaries around.

Now the users:

$ awk -F: '{print $1, $3, $7}' rootfs/etc/passwd | head -4
root 0 /bin/bash
daemon 1 /usr/sbin/nologin
bin 2 /usr/sbin/nologin
sys 3 /usr/sbin/nologin
$ grep www-data rootfs/etc/passwd
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin

Almost every account is a system user whose shell is /usr/sbin/nologin. Nobody logs in as www-data. It exists so a web server can run as an account that owns only its own files. When that process is compromised, the attacker gets www-data, not root. The permissions lesson explains the file-mode side of this.

What the image does not have tells you something too. /boot is empty, because there is no kernel: a container borrows the host’s. There is no /usr/bin/systemctl either, because nothing inside a container image needs an init system. A real server has both. The next lesson is about the second one.

The first minute on a box

When you land on an unfamiliar server, you want four answers quickly. These are the commands I would type. They are Linux commands, and I did not run them here because I had no Linux host.

cat /etc/os-release        # what is it?
uptime; free -h; df -h     # is it healthy: load, memory, disk?
ss -tlnp                   # what is listening on which port?
systemctl --failed         # which services are broken?
journalctl -p err -b       # what errors since the last boot?

uptime shows the load average. free -h shows memory, and the column to read is available, not free, because Linux uses spare memory as cache. df -h is the one that catches most outages: a full disk stops databases, logs and package installs at once. The disk usage lesson covers df and du, and processes, ps and top covers what is running. ss comes back in the firewall and troubleshooting lesson.

A habit worth having from day one: change a server through something you can repeat, such as a package, a config file kept in Git, or later a tool like Ansible. A box that was fixed by hand at 3 a.m. works until someone has to build a second one.

About the video

“10 Useful Linux Commands Every SysAdmin Needs to Know” is from Learn Linux TV (Jay LaCroix), published January 2025, 15 minutes. Its chapters cover the package manager, top, ps, df, ls, chmod/chown, systemctl, journalctl, rsync and grep, which lines up closely with the first-minute list above. It does not cover the filesystem layout or system users, which is why this lesson spends time on them. English was judged from the title, description, channel and its English auto-caption track. The freeCodeCamp course in deeper is a 5.5-hour full treatment, chaptered by topic.

Where this fits

You now know where things live and what to look at first. Next, how a server keeps your program running after you log out and after a reboot: running services with systemd.

Check yourself

  1. 01You change an nginx setting and want to find where it lives. Which directory do you check first, and why?

    /etc, because on a Linux system that is where configuration files live by convention. The nginx package puts its config in /etc/nginx.

  2. 02Why does a server have an account called www-data with the shell /usr/sbin/nologin?

    So a web server can run as an unprivileged user that owns only what it needs. The nologin shell means nobody can use that account for an interactive login.

  3. 03On a newer Debian system, /bin is a symlink to usr/bin. What does that tell you?

    The system uses a merged /usr layout, so programs that used to be split between /bin and /usr/bin all live under /usr. Scripts using either path still work.

  4. 04Which three commands would you run in the first minute on a server you have never seen?

    Something like cat /etc/os-release to see the distribution, df -h and free -h for disk and memory, and systemctl --failed or journalctl -p err -b for recent problems.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark