150+ Linux System Admin Interview Questions (2027)

155 Linux admin interview questions with answers: systemd, journald, LVM, permissions, ACLs, SELinux, nmcli, dnf and apt, boot recovery and RHEL 10.

Sep 6, 2025 - 11:51
Nov 7, 2026 - 00:05
 0  382
150+ Linux System Admin Interview Questions (2027)

Linux system administration interview questions test whether you can keep servers running: processes and systemd services, logs in journald, storage with partitions, LVM and filesystems, permissions, ACLs and SELinux, networking with nmcli and ip, users and sudo, package management with dnf and apt, boot troubleshooting and performance analysis. This page has 155 questions with direct answers, grouped by experience level, plus scenario questions.

Commands follow current Red Hat Enterprise Linux 10 documentation and the man pages, with Debian and Ubuntu equivalents where they differ. If you are new to RHEL 10, start with our beginner's guide to setting up RHEL 10, then come back to these questions.

Key takeaways

  • Freshers are asked about the filesystem hierarchy, permissions, users and groups, processes, signals, basic networking and package installation.
  • With 2 to 5 years of experience you should be able to manage systemd units, read the journal, extend an LVM volume online, fix SELinux denials and configure a static IP with nmcli.
  • Senior rounds focus on boot recovery, performance analysis method, kernel tuning, hardening, automation at scale and calm incident handling.
  • RHEL 10 removed support for ifcfg network files and the ifup/ifdown scripts, removed teamd (use bonding), removed dhclient, and ships no modular content. Interviewers for RHEL roles expect you to know this.
  • RHEL 10 is based on the Linux 6.12 kernel and still uses DNF (version 4) for package management.
  • Scenario questions decide most experienced interviews. For each, say the symptom, the command that confirms the cause, the fix and how you prevent a repeat.

How to use this guide

Each answer starts with a short reply you can give, followed by commands and detail for the follow-up question. For a wider DevOps round, the 200+ DevOps interview questions guide adds Git, CI/CD, containers and cloud.

Your experienceRead firstPractise this
Fresher or career switcherQuestions 1 to 50Create users, set permissions and install a web server on a RHEL or Ubuntu VM
2 to 5 yearsQuestions 51 to 115Add a disk, build LVM, mount it persistently, open a firewall port and fix an SELinux label
Senior, lead or architectQuestions 116 to 135Recover a host that does not boot, and investigate high load with vmstat, iostat and perf
Anyone with work experienceQuestions 136 to 155 (scenarios)Explain each scenario aloud in under two minutes

Linux interview questions for freshers

1. What does a Linux system administrator do?

A Linux administrator installs, configures and maintains Linux servers. Day to day that means managing users and access, installing updates, configuring storage and networking, watching logs and performance, running backups, applying security controls and fixing incidents. Most of the work is now automated with shell scripts and tools such as Ansible.

2. What is the difference between the kernel, the shell and user space?

The kernel manages hardware, memory, processes and filesystems. The shell (bash, zsh) is a program that reads your commands and asks the kernel to run them. User space is everything outside the kernel: the shell, system services, libraries and applications. Programs reach the kernel through system calls.

3. What is a Linux distribution?

A distribution packages the Linux kernel with a userland, a package manager, an installer and default configuration. RHEL, Fedora, CentOS Stream, Rocky Linux and AlmaLinux use RPM packages and DNF. Debian and Ubuntu use DEB packages and APT. SUSE uses RPM with zypper.

4. Explain the main directories in the filesystem hierarchy.

Linux follows the Filesystem Hierarchy Standard: one tree starting at /, with configuration in /etc, variable data in /var and programs in /usr. The main directories are:

DirectoryContents
/etcSystem configuration files
/varVariable data: logs, spool, caches, databases
/homeUsers' home directories
/rootRoot user's home directory
/usrInstalled programs, libraries and documentation; /bin and /sbin link into it on RHEL
/bootKernel, initramfs and boot loader files
/devDevice files
/proc, /sysVirtual filesystems exposing kernel and device information
/tmpTemporary files
/optOptional third-party software

5. What is the difference between an absolute and a relative path?

An absolute path starts from the root directory, such as /etc/ssh/sshd_config. A relative path starts from the current directory, such as ../logs/app.log. . means the current directory, .. the parent, and ~ your home directory.

6. What does "everything is a file" mean?

Linux exposes most resources through the filesystem. Regular files, directories, devices (/dev/sda), pipes, sockets and kernel data (/proc/meminfo) all appear as paths you can open, read or write with ordinary tools. ls -l shows the type in the first character: - file, d directory, l symlink, b block device, c character device, p pipe, s socket.

7. What is an inode?

An inode is the data structure that stores a file's metadata: owner, group, permissions, size, timestamps and pointers to its data blocks. It does not store the file name; directories map names to inode numbers. ls -i shows inode numbers and df -i shows inode usage, which matters because a filesystem can run out of inodes while it still has free space.

8. What is the difference between a hard link and a soft link?

A hard link is another directory entry pointing to the same inode, so the data stays until the last link is removed; hard links cannot cross filesystems or point to directories. A soft (symbolic) link is a separate file that contains a path; it can cross filesystems but breaks if the target is moved or deleted. Create them with ln target name and ln -s target name.

9. How do you read file permissions?

ls -l shows something like -rwxr-x---: three sets of read, write and execute for the owner, the group and others. In octal, r=4, w=2, x=1, so this is 750. On a directory, read lists names, write creates or deletes entries and execute lets you enter the directory.

10. How do you change permissions and ownership?

Use chmod for permissions, in octal or symbolic form, and chown or chgrp for ownership. Add -R to apply a change recursively.

chmod 640 report.txt          # octal
chmod u+x,g-w script.sh       # symbolic
chown asha:devops report.txt  # owner and group
chgrp devops report.txt       # group only
chmod -R g+rX /srv/shared     # recursive, X adds execute only on directories

11. What is umask?

umask removes permissions from the defaults given to new files (666) and directories (777). With a umask of 022, new files get 644 and directories 755; with 027 they get 640 and 750. Check it with umask, set it per shell in ~/.bashrc, and change the system default through the shell startup files or /etc/login.defs.

12. What are SUID, SGID and the sticky bit?

SUID on an executable runs it with the file owner's privileges (for example /usr/bin/passwd). SGID on an executable runs it with the group's privileges; on a directory it makes new files inherit the directory's group, useful for shared team folders. The sticky bit on a directory, as on /tmp, lets only a file's owner delete it. In octal they are 4000, 2000 and 1000.

13. What are /etc/passwd and /etc/shadow?

/etc/passwd lists accounts: name, UID, GID, comment, home directory and login shell; it is world-readable. /etc/shadow holds password hashes and ageing data and is readable only by root. Groups are in /etc/group and /etc/gshadow. Use getent passwd asha to query accounts, because it also covers LDAP or SSSD users.

14. How do you create, modify and delete a user?

useradd -m -s /bin/bash -c "Asha K" asha
passwd asha
usermod -aG wheel asha     # append to a supplementary group
usermod -L asha            # lock the account
userdel -r asha            # delete user and home directory

On Debian and Ubuntu, adduser is a friendlier wrapper. Always use -a with -G, or the user is removed from every other supplementary group.

15. What is the difference between primary and supplementary groups?

The primary group is stored in /etc/passwd and is assigned to files the user creates. Supplementary groups, listed in /etc/group, give extra access. id asha shows both. A user who was just added to a group must log in again (or run newgrp) before the new group applies to their session.

16. How do you set password ageing?

Use chage. chage -l asha shows the policy, chage -M 90 -W 7 asha sets a 90-day maximum with a 7-day warning, and chage -d 0 asha forces a change at next login. Defaults for new accounts come from /etc/login.defs.

17. What is sudo and how do you configure it?

sudo lets permitted users run commands as root or another user, with logging. Edit rules with visudo, which checks syntax before saving, and prefer drop-in files in /etc/sudoers.d/. On RHEL, members of the wheel group get full sudo by default; on Ubuntu it is the sudo group.

visudo -f /etc/sudoers.d/webops
# %webops ALL=(root) /usr/bin/systemctl restart httpd

18. What is the difference between su and sudo?

su switches to another user and needs that user's password; su - also loads their login environment. sudo runs a single command with elevated rights using your own password and records it in the logs, so access can be limited and audited. Most servers disable direct root login and rely on sudo.

19. What is a process and how do you list processes?

A process is a running instance of a program with its own PID, memory and open files. ps aux or ps -ef lists all processes, ps -ef --forest shows the tree, pgrep -a nginx finds by name, and top or htop show live usage. Each process has a parent (PPID); PID 1 is systemd on modern distributions.

20. What are process states?

The main states shown by ps are R (running or runnable), S (interruptible sleep, waiting for an event), D (uninterruptible sleep, usually waiting on I/O), T (stopped), and Z (zombie, finished but not yet reaped by its parent). Many processes in D state often point to storage or NFS problems.

21. What is a zombie process and how do you remove it?

A zombie has exited but its parent has not read its exit status. It uses no CPU or memory, only a process table entry. You cannot kill a zombie itself. Signal or fix the parent so it calls wait, or kill the parent; the zombie is then adopted by PID 1 and reaped. Find them with ps -eo pid,ppid,stat,cmd | awk '$3 ~ /Z/'.

22. What are signals? Name the common ones.

Signals are notifications sent to processes. SIGTERM (15) asks a process to exit cleanly and is the default for kill. SIGKILL (9) ends it immediately and cannot be caught. SIGHUP (1) often makes daemons reload configuration. SIGINT (2) is Ctrl+C, SIGSTOP and SIGCONT pause and resume. Use kill -15 PID first and SIGKILL only if that fails.

23. What do nice and renice do?

They set scheduling priority. Niceness ranges from -20 (highest priority) to 19 (lowest), default 0. nice -n 10 backup.sh starts a job at lower priority and renice -n 5 -p 1234 changes a running process. Only root can raise priority (lower the number).

24. How do you run a job in the background?

Add & to start a command in the background, use Ctrl+Z to suspend a foreground job, bg to resume it in the background, fg to bring it back and jobs to list jobs. To keep a job running after logout use nohup, a terminal multiplexer such as tmux, or better, a systemd service or systemd-run.

25. How do you check disk space and directory sizes?

df -h shows free space per mounted filesystem, and df -i shows inodes. du -sh /var/* shows the size of each directory, and du -xh / --max-depth=1 | sort -h stays on one filesystem. lsblk lists block devices and their mount points.

26. How do you check memory usage?

free -h shows total, used, free and available memory plus swap. Focus on "available", because Linux uses spare memory for page cache, which it frees when applications need it. /proc/meminfo has the detail, and vmstat 1 shows paging activity over time.

27. What does load average mean?

Load average, shown by uptime and top, is the average number of tasks that are running, waiting for CPU, or in uninterruptible sleep over 1, 5 and 15 minutes. Compare it with the number of CPUs (nproc). A load of 8 on an 8-CPU host is busy but not overloaded; high load with idle CPU usually means tasks are waiting on I/O.

28. How do you find files?

Use find to search the live filesystem by name, age, size, owner or permissions, and locate for fast name lookups from an index.

find /var/log -name "*.log" -mtime +7       # older than 7 days
find / -xdev -type f -size +500M            # large files on one filesystem
find /srv -user asha -perm -o+w             # world-writable files owned by asha
locate sshd_config                          # uses a prebuilt index (plocate or mlocate)

29. How do you search inside files?

Use grep. grep -i error app.log ignores case, -r searches directories, -n shows line numbers, -v inverts the match, -E enables extended regular expressions and -C 3 shows context.

30. What do the pipe and redirection operators do?

| sends one command's output to another's input. > writes output to a file, replacing it, and >> appends. 2> redirects errors, 2>&1 sends errors to the same place as output, and < reads input from a file. tee writes to a file and the screen at once.

31. How do you view and follow log files?

less for paging, tail -n 100 for the end and tail -f to follow new lines. On systemd systems most service logs are in the journal, so use journalctl -u sshd and journalctl -f. Traditional text logs live in /var/log, such as /var/log/messages and /var/log/secure on RHEL or /var/log/syslog and /var/log/auth.log on Ubuntu.

32. How do you install packages on RHEL and on Ubuntu?

TaskRHEL / Fedora (dnf)Debian / Ubuntu (apt)
Installdnf install httpdapt install apache2
Update alldnf upgradeapt update && apt upgrade
Removednf remove httpdapt remove apache2
Searchdnf search nginxapt search nginx
Which package owns a filerpm -qf /usr/bin/sshdpkg -S /usr/bin/ssh
Which package provides a filednf provides */semanageapt-file search semanage
List installedrpm -qa or dnf list --installeddpkg -l or apt list --installed

33. What is the difference between rpm and dnf?

rpm installs, queries and verifies individual package files but does not resolve dependencies or use repositories. dnf works with repositories, resolves dependencies, keeps a transaction history and uses rpm underneath. Use rpm -q, rpm -ql and rpm -V for queries and verification, and dnf for installs and updates.

34. Where are repositories configured?

On RHEL, repository definitions are .repo files in /etc/yum.repos.d/, and dnf repolist lists enabled ones. Registered RHEL systems get Red Hat repositories through subscription-manager. On Debian and Ubuntu, sources live in /etc/apt/sources.list and /etc/apt/sources.list.d/; newer Ubuntu releases use the deb822 .sources format.

35. How do you check which ports are listening?

Use ss -tulpn: TCP and UDP, listening sockets, process names, numeric output. ss -tn state established shows active connections. netstat comes from the older net-tools package and is not installed by default on recent distributions.

36. How do you check the IP address and routes?

ip -br addr          # brief list of interfaces and addresses
ip addr show eth0
ip route             # routing table
ip route get 8.8.8.8 # which route and source address would be used
ip link              # link state

ifconfig and route are from net-tools and are deprecated in favour of ip.

37. How do you test network connectivity?

Work up the stack: ip link for the link, ip addr and ip route for addressing, ping the gateway and a remote IP, dig or host for DNS, tracepath or traceroute for the path, and curl -v or nc -zv host port to test a TCP port. Each step narrows where the failure is.

38. What is /etc/hosts and how is name resolution ordered?

/etc/hosts maps names to IP addresses locally. /etc/nsswitch.conf decides the order of sources; the hosts: line usually checks files before DNS. DNS servers come from /etc/resolv.conf, which NetworkManager or systemd-resolved manages on most systems. getent hosts name follows the same order applications use.

39. What is SSH and how do you set up key-based login?

SSH provides encrypted remote login and file transfer. Generate a key pair on your machine, copy the public key to the server, then log in without a password.

ssh-keygen -t ed25519
ssh-copy-id [email protected]
ssh [email protected]

The public key goes into ~/.ssh/authorized_keys, which must not be writable by others or sshd will ignore it.

40. How do you copy files between servers?

scp file user@host:/path for simple copies, rsync -avz src/ user@host:/dest/ for efficient syncs that only send changes and can resume, and sftp for interactive transfer. rsync with --delete mirrors a directory, so test with --dry-run first.

41. How do you create and extract archives?

Use tar: -c creates, -x extracts, -t lists, and -z or -J add gzip or xz compression.

tar -czvf backup.tar.gz /etc      # create gzip archive
tar -cJvf backup.tar.xz /etc      # xz compression
tar -tvf backup.tar.gz            # list contents
tar -xzvf backup.tar.gz -C /tmp   # extract into /tmp

42. How do you schedule a recurring job?

Use cron or systemd timers. crontab -e edits a user's crontab with five time fields (minute, hour, day of month, month, day of week) followed by the command. System jobs can go in /etc/cron.d/. Systemd timers add logging in the journal, dependencies and catch-up of missed runs with Persistent=true.

# run a backup at 02:30 every day
30 2 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1

43. How do you schedule a one-time job?

Use at, for example echo "/usr/local/bin/report.sh" | at 23:00; atq lists jobs and atrm removes them. The atd service must be running. systemd-run --on-calendar or --on-active creates a transient timer as an alternative.

44. What are environment variables?

Named values passed to processes, such as PATH, HOME and LANG. env lists them, export VAR=value sets one for the current shell and its children, and ~/.bashrc or ~/.bash_profile make it persistent. System-wide settings go in /etc/profile.d/. Services started by systemd do not read shell files; set their variables with Environment= in the unit.

45. How do you check system information?

hostnamectl shows the hostname, OS and kernel; cat /etc/os-release the distribution; uname -r the running kernel; lscpu the CPU; free -h memory; lsblk disks; lspci and lsusb hardware; uptime how long it has run.

46. How do you change the hostname?

hostnamectl set-hostname web01.example.com sets it immediately and writes /etc/hostname. Add the name to /etc/hosts or DNS if other systems need to resolve it.

47. What is swap?

Swap is disk space the kernel uses when memory is under pressure, moving rarely used pages out of RAM. It prevents out-of-memory kills in short spikes but is much slower than RAM, so heavy swapping hurts performance. swapon --show lists swap, and vm.swappiness tunes how readily the kernel swaps.

48. What text editors should an administrator know?

vi or vim, because it is present on almost every system, including minimal and rescue environments. Know how to open, insert, save (:w), quit (:q, :q!), search (/text) and replace (:%s/old/new/g). nano is easier for beginners where installed.

49. How do you get help on a command?

man command opens the manual, man -k keyword searches manual descriptions, command --help prints a short summary, and /usr/share/doc holds package documentation. Man page sections matter: man 5 passwd describes the file, while man 1 passwd describes the command.

50. What is the difference between a login shell and a non-login shell?

A login shell, such as an SSH session or su -, reads /etc/profile and ~/.bash_profile. A non-login interactive shell, such as a new terminal tab, reads ~/.bashrc. Most distributions make .bash_profile source .bashrc so settings apply in both.

Linux interview questions for 2 to 5 years of experience

51. What is systemd?

systemd is the init system and service manager that runs as PID 1 on RHEL, Ubuntu, Debian and most other distributions. It starts services in parallel based on dependencies, supervises and restarts them, manages mounts, timers and sockets, and includes journald for logging. Everything it manages is a unit.

52. What unit types does systemd use?

Common types are .service (daemons and one-shot jobs), .socket (socket activation), .timer (scheduled activation), .target (groups of units, similar to runlevels), .mount and .automount (filesystems), .path (file watching), .slice (resource control groups) and .device. systemctl list-units --type=service lists active services.

53. Which systemctl commands do you use daily?

systemctl status httpd
systemctl start|stop|restart|reload httpd
systemctl enable --now httpd      # start now and at boot
systemctl disable httpd
systemctl is-enabled httpd
systemctl list-units --failed
systemctl daemon-reload           # after editing unit files

54. What is the difference between disable and mask?

disable removes the links that start a unit at boot, but the unit can still be started manually or as a dependency. mask links the unit to /dev/null, so it cannot be started at all until you unmask it. Mask services that conflict with ones you use, for example iptables when firewalld manages the firewall.

55. Where do unit files live, and how do you override them safely?

Packaged units live in /usr/lib/systemd/system/; local units and overrides go in /etc/systemd/system/, which takes priority. Use systemctl edit httpd to create a drop-in file under httpd.service.d/ that changes only the settings you specify and survives package updates. systemctl cat httpd shows the merged result.

56. How do you write a simple service unit?

[Unit]
Description=Example API
After=network-online.target
Wants=network-online.target

[Service]
User=api
ExecStart=/opt/api/bin/server --port 8080
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Save it as /etc/systemd/system/api.service, run systemctl daemon-reload, then systemctl enable --now api.

57. What are systemd targets?

Targets group units to reach a system state. multi-user.target is a full text-mode system, graphical.target adds the desktop, rescue.target is single-user with basic services, and emergency.target is a minimal shell with the root filesystem read-only. systemctl get-default and systemctl set-default multi-user.target manage the boot target, and systemctl isolate switches now.

58. How do you create a systemd timer?

Create a service unit that runs the job and a timer unit with the same name that schedules it, then enable the timer. systemctl list-timers shows next and last runs.

# /etc/systemd/system/backup.timer
[Unit]
Description=Nightly backup

[Timer]
OnCalendar=*-*-* 02:30:00
Persistent=true

[Install]
WantedBy=timers.target

59. What is journald and how do you query it?

journald is systemd's logging service. It collects kernel messages, service output and syslog messages into an indexed binary journal that you read with journalctl.

journalctl -u nginx --since "1 hour ago"
journalctl -p err -b            # errors since this boot
journalctl -b -1                # previous boot
journalctl -k                   # kernel messages
journalctl -f                   # follow
journalctl --disk-usage

60. How do you make the journal persistent across reboots?

With the default Storage=auto, journald writes to disk only if /var/log/journal exists; otherwise logs are kept in /run/log/journal and lost at reboot. Create the directory or set Storage=persistent in /etc/systemd/journald.conf (or a drop-in), then restart systemd-journald. Limit size with SystemMaxUse=.

61. What is the relationship between journald and rsyslog?

On RHEL, journald receives messages first and rsyslog reads them and writes traditional text files like /var/log/messages, applying rules from /etc/rsyslog.conf and /etc/rsyslog.d/. rsyslog is also used to forward logs to a central server. logrotate rotates the text files; the journal manages its own size.

62. How does logrotate work?

logrotate runs daily (through a systemd timer or cron) and rotates logs according to /etc/logrotate.conf and files in /etc/logrotate.d/: how often, how many copies to keep, compression, and commands to run after rotation such as reloading the service. logrotate -d /etc/logrotate.d/app tests a configuration without changing anything.

63. How do you add a new disk and partition it?

Identify it with lsblk, then partition with parted, fdisk or gdisk. Use GPT for new disks. Run udevadm settle or check lsblk again so the new partition appears.

parted /dev/sdb mklabel gpt
parted /dev/sdb mkpart data xfs 1MiB 100%
lsblk /dev/sdb

64. What is the difference between MBR and GPT?

MBR supports up to four primary partitions (more with an extended partition) and disks up to 2 TiB. GPT supports disks far larger than that, 128 partitions by default, keeps a backup partition table at the end of the disk and is required for UEFI boot from the disk. Use GPT for new systems.

65. How do you create a filesystem and mount it?

mkfs.xfs /dev/sdb1
mkdir /data
mount /dev/sdb1 /data
findmnt /data

XFS is the default filesystem on RHEL. ext4 is common on Debian and Ubuntu. Both are journaling filesystems.

66. How do you mount a filesystem persistently?

Add a line to /etc/fstab using the UUID from blkid, because device names like /dev/sdb1 can change. Then run systemctl daemon-reload and mount -a to test before rebooting; a bad fstab line can stop the system booting normally. Use nofail for disks that may be missing.

UUID=2c1f...e9a  /data  xfs  defaults  0 0

67. What is LVM and why use it?

Logical Volume Manager adds a layer between disks and filesystems. Physical volumes (PVs) are grouped into volume groups (VGs), and logical volumes (LVs) are carved from a VG. You can resize volumes online, add disks to a VG, move data between disks and take snapshots, none of which plain partitions allow easily. Our post on how LVM improves storage flexibility explains the model.

68. Walk through creating an LVM volume.

pvcreate /dev/sdb1
vgcreate vg_data /dev/sdb1
lvcreate -n lv_app -L 20G vg_data
mkfs.xfs /dev/vg_data/lv_app
mkdir /app
mount /dev/vg_data/lv_app /app
pvs; vgs; lvs     # check each layer

69. How do you extend a logical volume and its filesystem?

If the VG has free space, extend the LV and grow the filesystem in one command with -r (--resizefs). If not, add a disk to the VG first with pvcreate and vgextend. XFS and ext4 can both grow while mounted.

lvextend -r -L +10G /dev/vg_data/lv_app
lvextend -r -l +100%FREE /dev/vg_data/lv_app
# manual alternative: xfs_growfs /app  or  resize2fs /dev/vg_data/lv_app

70. Can you shrink an XFS filesystem?

No. XFS can grow but cannot shrink. To make an XFS volume smaller you back up the data, recreate a smaller LV and filesystem, and restore. ext4 can be shrunk, but only while unmounted and after e2fsck; lvreduce -r handles the filesystem resize for ext4.

71. What are LVM snapshots used for?

A snapshot records the state of an LV at a point in time using copy-on-write, so you can take a consistent backup or roll back after a risky change. Create one with lvcreate -s -n snap -L 5G /dev/vg_data/lv_app. Classic snapshots slow writes and become invalid if they fill up, so size them for the expected change rate and remove them afterwards. Thin-provisioned LVs support more efficient thin snapshots.

72. How do you add swap space?

Create a logical volume or partition, format it with mkswap, enable it with swapon and add it to /etc/fstab.

lvcreate -n lv_swap -L 4G vg_data
mkswap /dev/vg_data/lv_swap
swapon /dev/vg_data/lv_swap
# /etc/fstab
/dev/vg_data/lv_swap  none  swap  defaults  0 0

A swap file also works: create it with dd, set mode 600, then run mkswap and swapon.

73. How do you mount an NFS share?

Install the client tools (nfs-utils on RHEL, nfs-common on Ubuntu), check exports with showmount -e server for NFSv3 servers, and mount it. For persistence, add an fstab entry with _netdev, or use a systemd automount so boot does not hang if the server is down.

mount -t nfs nfs01:/exports/data /mnt/data
# /etc/fstab
nfs01:/exports/data  /mnt/data  nfs  defaults,_netdev  0 0

74. What is autofs?

autofs mounts filesystems on demand when a path is accessed and unmounts them after a period of inactivity. It is commonly used for NFS home directories. The master map /etc/auto.master points to map files that list keys and remote locations. Systemd automount units (x-systemd.automount in fstab) are a lighter alternative for a few mounts.

75. What are ACLs and when do you need them?

Access control lists give permissions to specific extra users or groups beyond the single owner and group. Use them when, for example, two teams need different access to the same directory. A + after the permissions in ls -l shows an ACL is present.

setfacl -m u:ravi:rwx /srv/project
setfacl -m g:qa:rx /srv/project
setfacl -d -m g:qa:rx /srv/project   # default ACL for new files
getfacl /srv/project
setfacl -x u:ravi /srv/project       # remove an entry

76. What is the ACL mask?

The mask sets the maximum permissions for named users, named groups and the owning group in an ACL. If the mask is r-x, a user entry of rwx is effectively r-x; getfacl shows this as "effective". Running chmod on a file with an ACL changes the mask, which surprises people when ACL access suddenly shrinks.

77. What is SELinux?

SELinux is mandatory access control built into the kernel. Every process and file has a security context, and the policy decides which process types can access which file types, regardless of normal permissions. On RHEL it is enforcing by default with the targeted policy, which confines network services such as httpd and sshd. Our post on SELinux in RHEL 10 covers the basics.

78. What are the SELinux modes?

Enforcing blocks and logs denials. Permissive logs denials but allows the access, which is useful for troubleshooting. Disabled turns SELinux off and is not recommended. getenforce shows the mode, setenforce 0 or 1 switches between permissive and enforcing until reboot, and /etc/selinux/config sets the boot mode. Switching from disabled to enabled needs a full relabel.

79. How do you view and fix SELinux file contexts?

ls -Z shows file contexts and ps -eZ process contexts. To label a custom web directory permanently, add a rule with semanage fcontext and apply it with restorecon. chcon changes a label only until the next relabel, so avoid it for permanent fixes.

semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
restorecon -Rv /web
ls -Zd /web

80. What are SELinux booleans?

Booleans are on and off switches for optional parts of the policy, such as allowing httpd to connect to the network or to read home directories. getsebool -a lists them, semanage boolean -l adds descriptions, and setsebool -P httpd_can_network_connect on changes one permanently (without -P the change is lost at reboot).

81. How do you troubleshoot an SELinux denial?

Check for AVC messages with ausearch -m AVC -ts recent or journalctl -t setroubleshoot. If setroubleshoot-server is installed, sealert -a /var/log/audit/audit.log explains each denial and suggests a fix. The fix is usually a wrong file label (restorecon), a boolean (setsebool -P) or a non-standard port (semanage port). Generating a custom module with audit2allow is the last resort.

82. How do you let a service listen on a non-standard port under SELinux?

Add the port to the right SELinux port type, then open it in the firewall.

semanage port -a -t http_port_t -p tcp 8081
semanage port -l | grep http_port_t
firewall-cmd --permanent --add-port=8081/tcp
firewall-cmd --reload

83. What is firewalld?

firewalld is the default firewall manager on RHEL. It uses zones (sets of rules applied to interfaces or source addresses) and services (named port definitions) and programs nftables underneath. Runtime changes apply immediately; --permanent changes are written to disk and take effect after --reload. Ubuntu uses ufw by default as a simpler front end.

84. Which firewall-cmd commands do you use most?

firewall-cmd --state
firewall-cmd --get-active-zones
firewall-cmd --list-all
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-port=9090/tcp
firewall-cmd --permanent --zone=internal --add-source=10.0.0.0/24
firewall-cmd --reload

85. How is networking configured on RHEL 10?

NetworkManager manages all connections, and profiles are stored as keyfiles in /etc/NetworkManager/system-connections/. RHEL 10 removed support for the old ifcfg files in /etc/sysconfig/network-scripts/ and the ifup and ifdown scripts. You manage connections with nmcli, nmtui or the RHEL system roles for Ansible.

86. How do you set a static IP with nmcli?

nmcli connection show
nmcli connection modify eth0 ipv4.method manual \
  ipv4.addresses 192.168.10.20/24 ipv4.gateway 192.168.10.1 \
  ipv4.dns "192.168.10.2 192.168.10.3"
nmcli connection up eth0
nmcli device status

Our post on configuring networking in RHEL 10 covers more cases.

87. How do you configure networking on Ubuntu servers?

Ubuntu Server uses Netplan. You write YAML files in /etc/netplan/, and Netplan renders them for systemd-networkd (the default on servers) or NetworkManager. netplan try applies the change with automatic rollback if you lose access, and netplan apply makes it permanent.

88. What is network bonding, and what replaced teaming on RHEL 10?

Bonding combines several interfaces into one logical link for redundancy or more throughput, using modes such as active-backup and 802.3ad (LACP). RHEL 10 removed the teamd service and libteam, so bonding is the supported option. Create a bond with nmcli connection add type bond and add ports with type ethernet ... master bond0.

89. How do you add a static route?

Temporarily with ip route add 10.20.0.0/16 via 192.168.10.254. Persistently, add it to the connection profile so NetworkManager restores it: nmcli connection modify eth0 +ipv4.routes "10.20.0.0/16 192.168.10.254", then bring the connection up again.

90. How do you troubleshoot DNS resolution?

Check /etc/resolv.conf (and resolvectl status if systemd-resolved is used), query the server directly with dig @192.168.10.2 example.com, compare with getent hosts example.com to include /etc/hosts and nsswitch, and confirm UDP and TCP port 53 are reachable. A name that works with dig but fails in applications often points to nsswitch or a stale cache.

91. How do you capture network traffic?

Use tcpdump. For example, tcpdump -i eth0 -nn port 443 shows HTTPS traffic without resolving names, host 10.0.0.5 filters by address and -w capture.pcap saves to a file for Wireshark. Capture only what you need and protect the files, since they can contain sensitive data.

92. How do you harden SSH?

Use key-based authentication and set PasswordAuthentication no, keep PermitRootLogin at no or prohibit-password, limit access with AllowUsers or AllowGroups, keep the system crypto policy, and add rate limiting or fail2ban where needed. Put settings in /etc/ssh/sshd_config.d/, check them with sshd -t, and keep a second session open while you reload.

93. Describe the Linux boot process.

Firmware (UEFI or BIOS) runs and loads the boot loader (GRUB2). GRUB loads the kernel and the initramfs. The kernel initialises hardware and starts the initramfs, which loads drivers needed to find the root filesystem (storage, LVM, encryption) and mounts it. Control passes to systemd as PID 1, which starts units until it reaches the default target. systemd-analyze and systemd-analyze blame show how long each stage took.

94. How do you change kernel boot parameters on RHEL?

Use grubby, which updates the boot entries safely. For a one-time change, press e at the GRUB menu, edit the line starting with linux, and press Ctrl+X to boot.

grubby --info=DEFAULT
grubby --update-kernel=ALL --args="console=ttyS0"
grubby --update-kernel=ALL --remove-args="quiet"
grubby --set-default /boot/vmlinuz-<version>

95. How do you reset a forgotten root password on RHEL?

Interrupt GRUB, edit the kernel line and append rd.break, then boot. At the initramfs shell, remount the real root read-write, chroot into it, set the password, request an SELinux relabel and continue booting.

mount -o remount,rw /sysroot
chroot /sysroot
passwd root
touch /.autorelabel
exit
exit

96. What is the initramfs and when do you rebuild it?

The initramfs is a small filesystem loaded with the kernel that contains drivers and tools needed to mount the real root filesystem. Rebuild it after changing storage drivers, LVM or encryption configuration, or /etc/crypttab, with dracut -f on RHEL (or dracut -f --kver <version> for another kernel) and update-initramfs -u on Ubuntu.

97. What are rescue and emergency targets used for?

Rescue target starts a single-user system with local filesystems mounted, for repairs that need most of the system. Emergency target gives a root shell with only the root filesystem mounted read-only, for cases such as a broken /etc/fstab. Select them by adding systemd.unit=rescue.target or systemd.unit=emergency.target to the kernel line in GRUB.

98. How do you list installed kernels and boot an older one?

rpm -q kernel (or dnf list --installed kernel) lists installed kernels, and grubby --info=ALL shows boot entries. Choose the older entry at the GRUB menu for one boot, or make it the default with grubby --set-default. DNF keeps several kernels according to installonly_limit in /etc/dnf/dnf.conf, so a bad update can be backed out.

99. How do you use dnf history?

dnf history lists past transactions, dnf history info 42 shows what one changed, and dnf history undo 42 reverses it, provided the older package versions are still available in the repositories. It is a fast way to back out a bad update.

100. What are Application Streams and what happened to modules in RHEL 10?

Application Streams deliver multiple versions of user-space components, such as language runtimes and databases, on a different life cycle from the base OS. RHEL 8 and 9 shipped some of them as modules (dnf module). Red Hat's RHEL 10 adoption guide says no modular content is distributed with RHEL 10; alternative versions are shipped as normal packages instead.

101. How do you keep a system patched automatically?

On RHEL, install dnf-automatic, configure /etc/dnf/automatic.conf (for example security updates only), and enable dnf-automatic.timer. On Ubuntu, use unattended-upgrades. In larger estates, patching usually runs through Red Hat Satellite, Ansible or similar tools in waves, with a test group first.

102. How do you check whether a reboot is needed after updates?

On RHEL, run dnf needs-restarting -r, which reports whether core packages such as the kernel or glibc changed since boot, and dnf needs-restarting -s to list services to restart. On Ubuntu, check for /var/run/reboot-required. Compare uname -r with the newest installed kernel as a quick check.

103. How do you investigate high CPU usage?

Run top or htop and sort by CPU to find the process. Check whether time is user (us), system (sy), I/O wait (wa) or steal (st, on virtual machines). pidstat -u 1 tracks per-process usage over time, and perf top shows which functions are using CPU. High steal means the hypervisor is starving the VM, not a problem inside the guest.

104. What does vmstat show?

vmstat 1 prints one line per second: run queue (r), blocked processes (b), swap in and out (si, so), block I/O (bi, bo), interrupts and context switches, and CPU split into user, system, idle, wait and steal. A run queue above the CPU count means CPU saturation; non-zero si and so means memory pressure.

105. How do you investigate disk I/O problems?

iostat -xz 1 (from sysstat) shows per-device utilisation, queue size and latency (r_await, w_await). iotop or pidstat -d 1 shows which processes do the I/O. High latency with high utilisation means the device is saturated; high latency at low utilisation points to the storage backend or the network for SAN and NFS.

106. What is sar used for?

sar, from the sysstat package, collects and reports historical performance data: CPU (sar -u), memory (sar -r), disks (sar -d), network (sar -n DEV) and more. Once the sysstat collection timer is enabled, you can look back at what happened at 3 a.m. when an incident started, which live tools cannot show.

107. What is the OOM killer?

When the system runs out of memory and cannot reclaim enough, the kernel's out-of-memory killer chooses a process, usually the one using the most memory adjusted by oom_score_adj, and kills it. Find events with journalctl -k | grep -i oom or dmesg. Fix the cause (a leak, too little memory, missing limits) rather than only restarting the service; systemd's MemoryMax= can cap a service.

108. How do you find which process has a file open?

lsof /var/log/app.log lists processes with that file open, lsof -p PID shows a process's open files, lsof -i :8080 shows who uses a port, and fuser -vm /data lists processes keeping a filesystem busy. Deleted files still held open show up with lsof +L1.

109. What are ulimits?

Resource limits per process, such as maximum open files (nofile) and processes (nproc). ulimit -a shows the current shell's limits. For login sessions, set them in /etc/security/limits.conf or limits.d/. For systemd services, those files do not apply; use LimitNOFILE= in the unit or a drop-in.

110. What is sysctl?

sysctl reads and sets kernel parameters under /proc/sys. sysctl net.ipv4.ip_forward reads a value, sysctl -w changes it until reboot, and files in /etc/sysctl.d/ make changes persistent, loaded with sysctl --system. Common tunables include vm.swappiness, net.core.somaxconn and fs.file-max.

111. What is tuned?

tuned is a RHEL service that applies performance profiles (sysctl values, CPU governor, disk settings) for a workload. tuned-adm list shows profiles, tuned-adm active the current one, tuned-adm recommend a suggestion and tuned-adm profile throughput-performance switches. virtual-guest is common for VMs.

112. How do you manage time synchronisation?

RHEL uses chrony. Servers are set in /etc/chrony.conf, chronyc sources -v shows the time sources, and chronyc tracking shows the offset. timedatectl shows time zone and sync status, and timedatectl set-timezone Asia/Kolkata changes the zone. Bad time breaks TLS, Kerberos, log correlation and clustered systems.

113. How do you check failed login attempts?

On RHEL, read /var/log/secure or journalctl -u sshd; on Ubuntu, /var/log/auth.log. lastb lists failed logins, last successful ones and faillock --user asha shows lockout counters where pam_faillock is enabled. Repeated failures from one address may justify fail2ban or firewall rules.

114. What is auditd?

auditd is the Linux audit daemon. It records security-relevant events defined by rules, such as changes to /etc/passwd, use of privileged commands or SELinux denials, in /var/log/audit/audit.log. auditctl -w /etc/sudoers -p wa -k sudoers adds a watch, persistent rules go in /etc/audit/rules.d/, and ausearch and aureport query the log.

115. How do you run containers on RHEL?

RHEL ships Podman, Buildah and Skopeo instead of Docker. Podman is daemonless, supports rootless containers and uses commands very close to Docker's (podman run, podman ps, podman build). To run a container as a service, write a Quadlet .container file under /etc/containers/systemd/ (or ~/.config/containers/systemd/ for rootless), run systemctl daemon-reload, and systemd generates the service.

Advanced Linux interview questions for senior administrators

116. How do you approach a performance problem methodically?

Define the symptom with numbers (latency, throughput, errors) and when it started. Then check each resource (CPU, memory, disk, network) for utilisation, saturation and errors, which is Brendan Gregg's USE method. Start with uptime, vmstat 1, mpstat -P ALL 1, iostat -xz 1, free -h, sar -n DEV 1 and the journal. Change one thing at a time and measure again.

117. What is the difference between page cache, buffers and used memory?

Page cache holds file data read from or written to disk, so later reads come from RAM. Buffers hold block device metadata. Both are reclaimable, which is why free shows a low "free" but a healthy "available" value. Memory used by processes (anonymous memory) cannot be dropped without swapping. Clearing caches with drop_caches on a production system usually makes performance worse.

118. How do cgroups work and how does systemd use them?

Control groups limit and account for CPU, memory, I/O and process counts for groups of processes. RHEL 9 and 10 use cgroup v2 with a single hierarchy. systemd puts each service in its own cgroup under slices, so you can set limits in a unit with CPUQuota=, MemoryMax= or TasksMax=, or live with systemctl set-property. systemd-cgtop shows usage per cgroup. Containers rely on the same mechanism.

119. What are namespaces?

Namespaces give processes their own isolated view of a system resource: PID, network, mount, UTS (hostname), IPC, user and cgroup namespaces. Combined with cgroups and SELinux, they are what containers are built from. lsns lists namespaces and nsenter -t PID -n runs a command in a process's network namespace, which helps debug container networking.

120. How do you trace what a process is doing?

strace -p PID shows system calls live, strace -f -e trace=file cmd shows which files a command opens, and strace -c summarises time per call. ltrace traces library calls. perf profiles CPU usage, and bpftrace or the BCC tools trace kernel and application events with low overhead. strace slows the traced process noticeably, so use it briefly in production.

121. How do you analyse a kernel crash?

Enable kdump so the kernel reserves memory (crashkernel=) and writes a vmcore to /var/crash when it panics. Check with kdumpctl status. Analyse the dump with the crash utility and the matching kernel debuginfo: bt for the backtrace, log for the kernel ring buffer. On RHEL, open a support case and attach the vmcore if the cause is a kernel bug.

122. How do you handle a disk that is failing?

Check journalctl -k for I/O errors and run smartctl -a /dev/sda from smartmontools. If the disk is in a RAID array, mark it failed and replace it (mdadm --manage /dev/md0 --fail /dev/sdb1 --remove /dev/sdb1, then add the new disk). If it is an LVM PV with free space elsewhere, move data off with pvmove and remove it with vgreduce. Confirm backups before you start.

123. How does software RAID work on Linux?

mdadm manages kernel software RAID: RAID 0 (striping), 1 (mirroring), 5 and 6 (parity) and 10. cat /proc/mdstat shows array state and rebuild progress, and mdadm --detail /dev/md0 the members. Save the configuration in /etc/mdadm.conf and rebuild the initramfs if the array is needed at boot. LVM can also create RAID logical volumes directly.

124. How do you encrypt a disk?

Use LUKS through cryptsetup: cryptsetup luksFormat /dev/sdc, then cryptsetup open /dev/sdc data creates /dev/mapper/data, which you format and mount. Add it to /etc/crypttab for unlocking at boot. For servers without someone to type a passphrase, Clevis with Tang (network-bound disk encryption) or a TPM can unlock automatically.

125. What are system-wide crypto policies on RHEL?

Crypto policies set the allowed protocols, ciphers and key sizes for TLS, SSH, Kerberos and other libraries from one place. update-crypto-policies --show shows the current policy (DEFAULT), and update-crypto-policies --set FUTURE or DEFAULT:SUBPOLICY changes it. Applications then follow the policy unless configured otherwise, so a policy change can break connections to old systems.

126. How do you harden a new RHEL server?

Install a minimal package set, apply updates, keep SELinux enforcing and firewalld active with only needed ports, use SSH keys and sudo instead of root logins, set password and lockout policy, enable auditd and central logging, disable unused services, and configure time sync. Scan against a profile such as CIS or STIG with OpenSCAP (oscap) and fix findings with the generated Ansible or Bash remediation. Our RHEL 10 hardening guide has a checklist.

127. What is AIDE?

AIDE (Advanced Intrusion Detection Environment) records checksums and attributes of important files in a database and later reports changes. Initialise it with aide --init, move the new database into place, and run aide --check on a schedule. Update the database after approved changes, or alerts lose their value.

128. How do you centralise authentication for many Linux servers?

Join them to an identity provider through SSSD: Red Hat Identity Management (IdM, based on FreeIPA) or Active Directory with realm join. SSSD caches credentials, supports Kerberos and sudo rules, and maps users and groups. Central identity means one place to disable an account, and IdM can also manage host-based access control and sudo policy.

129. How do you manage hundreds of servers consistently?

Use configuration management such as Ansible, with code in Git and changes reviewed. Build images from a standard definition (kickstart, Image Builder or image mode with bootc on RHEL), patch in waves, collect logs and metrics centrally, and keep an inventory or CMDB as the source of truth. Manual changes on individual servers should be the exception and fed back into the code.

130. What is image mode for RHEL?

Image mode builds and deploys the operating system as a bootable container image using bootc. You define the OS in a Containerfile, build and test it in a CI pipeline, push it to a registry, and hosts update by pulling the new image and rebooting into it, with rollback to the previous image. It suits fleets where every host should be identical. Package mode, managed with dnf, remains the traditional approach.

131. How do you plan a major version upgrade, for example RHEL 9 to 10?

Read Red Hat's "Considerations in adopting RHEL 10" for removed features that affect you: ifcfg files, teamd, dhclient, the Xorg server and modular content are all gone. Check application support, run the Leapp pre-upgrade report on a copy of the server, fix the inhibitors, and test. Many teams prefer building new RHEL 10 hosts and migrating workloads, especially when they use automation, because it gives a clean rollback path.

132. What should a backup strategy for Linux servers include?

Know what to back up (data, configuration, databases with consistent dumps or snapshots), how often (driven by recovery point objective), where (off the host and preferably off site, with one immutable or offline copy), and how long to keep it. Most importantly, test restores regularly and document the steps. Configuration in Git and automated rebuilds reduce how much of the OS needs backing up.

133. How do you write safer shell scripts?

Start with set -euo pipefail so errors, unset variables and failed pipes stop the script, quote variables ("$file"), use mktemp for temporary files and trap to clean up, check exit codes of critical commands, log what the script does, and run shellcheck before committing. Make scripts safe to run twice, the same idea as idempotency in Ansible.

#!/usr/bin/env bash
set -euo pipefail
tmp=$(mktemp)
trap 'rm -f "$tmp"' EXIT
df -h / > "$tmp"
grep -q '/' "$tmp" && echo "disk report ready"

134. How do you monitor Linux servers?

Collect metrics (CPU, memory, disk, network, service health) with an agent such as Prometheus node_exporter or Performance Co-Pilot, ship logs to a central system, and alert on symptoms users feel (errors, latency, full disks soon) rather than on every high CPU spike. Track trends so you can predict capacity, for example disk fill rate.

135. How do you run an incident on a production Linux server?

Stabilise first: restore service by failing over, restarting, rolling back or adding capacity, and capture evidence before it disappears (journal, ps, ss, dmesg). Communicate status regularly. Change one thing at a time and record each command. Afterwards, write a blameless review that covers timeline, root cause, contributing factors and actions that prevent a repeat.

Scenario-based Linux interview questions

136. The root filesystem is 100% full. What do you do?

Find what grew with du -xh / --max-depth=1 | sort -h and drill down; /var/log, /var/lib container storage and core dumps are common. Free space safely: compress or remove old logs, vacuum the journal (journalctl --vacuum-size=500M), clean the package cache (dnf clean all). If df and du disagree, a deleted file is still open (question 137). Then fix the cause: log rotation, retention or a larger volume.

137. df shows the disk full but du shows much less used. Why?

A process still has a deleted file open, so the space is not freed. Find it with lsof +L1 or lsof | grep deleted. Restart or reload the process to release it, or truncate the file through /proc/PID/fd/N (: > /proc/1234/fd/5) if a restart is not possible. This often happens when someone deletes a log instead of letting logrotate handle it.

138. You get "No space left on device" but df -h shows free space. What next?

Check inodes with df -i. Millions of small files, such as session files, mail queue entries or cache files, can exhaust inodes. Find the directory with the most files using find /var -xdev -type f | cut -d/ -f2-3 | sort | uniq -c | sort -n, clean up, and fix the application that creates them.

139. The server is slow and the load average is 40 on 8 CPUs. How do you investigate?

Run vmstat 1. A high r column with low idle means CPU saturation; find the processes with top. A high b column and high wa means tasks are blocked on I/O; check iostat -xz 1 and look for processes in D state with ps -eo stat,pid,cmd | grep "^D". Hung NFS mounts are a frequent cause of high load with idle CPUs.

140. A service fails to start after a configuration change. How do you troubleshoot?

Run systemctl status app and journalctl -u app -n 50 --no-pager for the error. Validate the configuration with the service's own check (nginx -t, httpd -t, sshd -t). Check SELinux denials with ausearch -m AVC -ts recent, file ownership, and whether the port is already taken (ss -tlnp). Restore the previous configuration from Git or backup if you cannot fix it quickly.

141. Apache returns 403 Forbidden for files in a new directory, but permissions look correct. Why?

Most likely SELinux: the files have a context such as user_home_t or default_t, which httpd may not read. Confirm with ls -Z and ausearch -m AVC. Fix with semanage fcontext -a -t httpd_sys_content_t "/newdir(/.*)?" and restorecon -Rv /newdir. Also check that every parent directory has execute permission for the apache user and that the Apache configuration allows the path.

142. You cannot SSH to a server. How do you troubleshoot?

Run ssh -vvv user@host to see where it stops. No route or timeout points to network, firewall or security group; "connection refused" means sshd is not listening; "permission denied" points to keys, the user, authorized_keys permissions or AllowUsers. Use the console (cloud serial console, iLO, vSphere) to check systemctl status sshd, firewall-cmd --list-all and journalctl -u sshd.

143. The server drops to emergency mode at boot after someone edited /etc/fstab. How do you fix it?

Log in at the emergency shell with the root password, remount root read-write with mount -o remount,rw /, and fix or comment out the bad line in /etc/fstab (wrong UUID, missing disk, typo in options). Run systemctl daemon-reload and mount -a to test, then reboot. Prevent it by testing with mount -a before rebooting and using nofail for non-critical disks.

144. A server will not boot after a kernel update. What do you do?

Choose the previous kernel at the GRUB menu. Once booted, check journalctl -b -1 -p err for the failed boot's errors. Common causes are a missing driver in the new initramfs (rebuild with dracut -f --kver) or a third-party kernel module that was not rebuilt. Make the working kernel the default with grubby --set-default until the problem is fixed.

145. An application was killed and the journal shows the OOM killer. What now?

Confirm with journalctl -k | grep -i "out of memory" and see which process used the memory. Decide whether it is a leak (memory grows steadily, so fix the application or schedule restarts), wrong sizing (add RAM or reduce heap and cache settings), or another process starving it (set MemoryMax= on noisy services). Add memory alerts so you see the trend before the next kill.

146. A volume group is out of space and the application needs 50 GB more. Walk through it.

Add a physical volume to the volume group, then grow the logical volume and filesystem online. Attach a new disk, find it with lsblk, then extend the VG and the LV online, growing the filesystem in the same step.

pvcreate /dev/sdc
vgextend vg_data /dev/sdc
lvextend -r -L +50G /dev/vg_data/lv_app
df -h /app

147. A host can ping IP addresses but not names. What is wrong?

DNS. Check /etc/resolv.conf for the right nameservers, test with dig @nameserver name, and check that port 53 is not blocked. If NetworkManager overwrote resolv.conf, set DNS on the connection with nmcli connection modify eth0 ipv4.dns "..." and ipv4.ignore-auto-dns yes if needed. Also check the hosts: line in /etc/nsswitch.conf.

148. A new static IP did not survive a reboot. Why?

It was set with ip addr add, which is temporary, or a DHCP profile on the same interface took over. Set it in the NetworkManager connection with nmcli connection modify, confirm ipv4.method manual and connection.autoconnect yes, and check that only one profile is active for that device (nmcli connection show --active). On RHEL 10, ifcfg files are no longer read, so an old ifcfg file will be ignored.

149. A cron job works when run by hand but fails from cron. Why?

cron runs with a minimal environment: a short PATH, no profile files and no terminal. Use full paths to commands, set variables at the top of the crontab or in the script, redirect output to a log to see the error, and check journalctl -u crond. Also check for unescaped % characters in the crontab line, which cron treats as newlines.

150. A user cannot write to a shared directory although they are in the right group. Why?

They have not logged in again since being added, so their session does not have the group yet (check with id). Other causes: the directory lacks group write, files were created without SGID so they have the wrong group, an ACL mask limits access, or SELinux labels block it. Set SGID with chmod 2775 and a default ACL so new files stay shareable.

151. Time on a server is off by several minutes and TLS connections fail. What do you do?

Check timedatectl and chronyc tracking. Make sure chronyd is running and the NTP servers in /etc/chrony.conf are reachable on UDP 123 (chronyc sources -v). For a large offset, chronyc makestep corrects it immediately. Find out why sync stopped, for example a firewall change or a VM that was paused, so it does not recur.

152. Someone ran chmod -R 777 on /var/www. How do you recover?

Restore sensible permissions: directories 755 and files 644 (find /var/www -type d -exec chmod 755 {} + and the same with -type f and 644), with stricter modes for configuration files containing secrets. For package-owned files, rpm --setperms and rpm -V can restore and verify. Then review who has root access and why, and manage these permissions through configuration management.

153. You suspect a server is compromised. What are your first steps?

Do not reboot or wipe it yet. Isolate it from the network (security group or switch port), notify the security team, and preserve evidence: memory if possible, running processes, network connections, logs and a disk snapshot. Check for unknown users, SSH keys, cron jobs, systemd units and SUID files, and use rpm -Va to find modified package files. Rebuild from a known-good image and rotate every credential the host held.

154. dnf fails with dependency or repository errors. How do you troubleshoot?

Read the message first. For repository errors, check network and proxy access, run dnf repolist, confirm the subscription (subscription-manager status) and run dnf clean all followed by dnf makecache. For dependency conflicts, look for third-party repositories providing conflicting versions, excluded or version-locked packages, and use dnf repoquery --whatprovides to find which repository supplies what.

155. A disk shows I/O errors in the kernel log and the filesystem went read-only. What do you do?

The kernel remounted the filesystem read-only to protect it. Check journalctl -k and smartctl -a to see if the disk or the storage path failed. Stop the application, make sure you have a recent backup, unmount and run the filesystem check (xfs_repair for XFS, e2fsck for ext4), and replace hardware if it is failing. On a VM or SAN, involve the storage team because the fault may be outside the host.

How to prepare for a Linux administration interview

Build a lab with two or three VMs running RHEL 10 (a no-cost Red Hat Developer subscription works) and Ubuntu, then break and fix things on purpose: fill a disk, corrupt fstab, mislabel a web directory, forget the root password. Being able to describe what you saw and the exact commands you ran carries more weight than memorised definitions. For more practice, work through our scenario-based Linux interview questions and the RHEL 10 RHCSA exam guide.

If you prefer guided labs, DevOps Training Institute offers Linux administration training and an RHCSA course, in a classroom in Kharadi, Pune and live online across India.

Frequently asked questions

Which Linux distribution should I learn for sysadmin interviews?

Learn one RPM-based distribution (RHEL 10 or a rebuild such as Rocky Linux or AlmaLinux) and one Debian-based one (Ubuntu Server). Most enterprise interviews in India focus on RHEL commands, while cloud roles often use Ubuntu, and the core skills carry over between them.

What changed in RHEL 10 that interviewers ask about?

Support for ifcfg network files and the ifup and ifdown scripts was removed, so networking is done through NetworkManager keyfiles and nmcli. teamd was removed in favour of bonding, dhclient was removed, the Xorg server was dropped except for Xwayland, and no modular content ships. RHEL 10 is based on the 6.12 kernel.

Is RHCSA useful for getting a Linux admin job?

RHCSA is a hands-on, performance-based exam, so passing it shows you can do the tasks rather than only describe them. Many employers that run RHEL list it as preferred. It does not replace experience you can explain in an interview, so keep a lab and notes.

Should I learn systemd or the older init scripts?

systemd. It is the init system on RHEL, Ubuntu, Debian and most current distributions. Know how to manage services, write a unit file, use drop-ins and timers, and read the journal. Knowing SysV init helps only with very old systems.

Do I need to know scripting for a Linux admin role?

Yes. Expect to write or read bash scripts for loops, conditions, text processing with grep, awk and sed, and safe error handling. Many roles also expect Ansible, and some Python, because most repeatable admin work is now automated.

How do I answer scenario-based Linux questions?

Describe the symptom, the command you would run first and what its output would tell you, then the fix and how you would prevent a repeat. Interviewers want to see an ordered process: check the logs, confirm the cause and only then change something.

How many Linux interview questions should I practise?

Be able to answer the freshers' section without notes, do the LVM, SELinux, networking and boot recovery tasks hands-on in a lab, and talk through at least ten scenario questions in detail. Practical depth matters more than the number of questions you have read.

References

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.