System Administrator interview questions
100 real questions with model answers and explanations for Junior candidates.
See a System Administrator resume example →Practice with flashcards
Spaced repetition · Hunter Pass
Questions
/ is the root of the filesystem hierarchy and contains or provides access to every other filesystem path.
- /etc stores host-specific system configuration files.
- /var stores variable data such as logs, caches, queues, and state files.
- /home contains the home directories and personal files of regular users.
- /tmp holds temporary files and may be cleared automatically, including at reboot.
Why interviewers ask this: These directories separate core hierarchy, configuration, changing data, user data, and temporary data by purpose.
An absolute path starts at the root directory, while a relative path is interpreted from the current working directory.
- An absolute path begins with /, such as /etc/hosts.
- A relative path does not begin with /, such as documents/report.txt.
- . refers to the current directory.
- .. refers to the parent directory.
Why interviewers ask this: The same relative path can resolve differently when the current working directory changes.
The first character in an ls -l entry indicates the type of the filesystem object.
- - means a regular file, and d means a directory.
- l means a symbolic link.
- b and c mean block and character device files.
- p means a named pipe, and s means a socket.
Why interviewers ask this: This type character is separate from the nine permission characters that follow it.
A hard link is another directory entry for the same inode, while a symbolic link is a separate file that stores a path to a target.
- Hard links share the target's inode and file contents.
- Symbolic links have their own inode and can point to directories.
- A hard link normally cannot cross filesystem boundaries, while a symbolic link can.
- Removing the original name does not break a hard link, but it can leave a symbolic link dangling.
Why interviewers ask this: The distinction comes from referring directly to an inode versus referring to another path.
Every Linux file has one owning user and one owning group used when permission checks are made.
- The owner permission bits apply when the accessing user is the file's owner.
- The group permission bits apply to eligible members of the file's group when owner bits do not apply.
- The other permission bits apply when neither the owner nor group class applies.
Why interviewers ask this: Ownership selects which user, group, or other permission class is evaluated for access.
The rwx bits have different effects depending on whether the object is a regular file or a directory.
- For a regular file, r reads its contents, w changes its contents, and x permits executing it as a program.
- For a directory, r lists its entries, w permits creating, deleting, or renaming entries, and x permits traversal and access to entries by name.
- Directory operations often require combinations, such as r with x for a useful listing or w with x to change entries.
Why interviewers ask this: Directory permissions govern names and traversal rather than reading, writing, or executing the directory itself.
Symbolic chmod notation specifies whose permissions change, the operation, and the permission bits.
- u, g, o, and a select the owner, group, others, or all classes.
- + adds permissions, - removes permissions, and = sets the selected permissions exactly.
- r, w, and x select read, write, and execute permission.
- chmod u+x,g-w file adds owner execute permission and removes group write permission.
Why interviewers ask this: Symbolic notation expresses permission changes without replacing unrelated permission bits.
Numeric chmod notation represents each permission class with an octal digit formed by adding permission values.
- Read has value 4, write has value 2, and execute has value 1.
- The three digits normally represent owner, group, and others in that order.
- Each digit ranges from 0 for no permissions to 7 for read, write, and execute.
- chmod 640 file gives the owner rw, the group r, and others no permissions.
Why interviewers ask this: Octal notation encodes each class's rwx combination as one digit.
chown changes file ownership, while chgrp changes a file's owning group.
- chown user file sets a new owning user.
- chown user:group file sets both the owning user and group.
- chgrp group file changes only the owning group.
Why interviewers ask this: These commands change ownership metadata rather than the rwx permission bits.
umask is a process setting that removes permission bits from the base mode requested when a new file or directory is created.
- Regular files commonly start from base mode 666, without execute bits.
- Directories commonly start from base mode 777.
- Each bit set in the umask is cleared from the corresponding base mode.
- With umask 022, the common results are 644 for files and 755 for directories.
Why interviewers ask this: Umask restricts requested default permissions and does not add permissions that are absent from the base mode.
/etc/passwd stores public account data, while /etc/shadow stores protected password and aging data.
- Each /etc/passwd entry includes the login name, UID, primary GID, descriptive field, home directory, and login shell.
- The password field in /etc/passwd is usually x, indicating that the password data is kept in /etc/shadow.
- /etc/shadow contains a password hash or a marker that locks or disables password login, not the plaintext password.
- /etc/shadow also records password aging values and is normally readable only by privileged processes.
Why interviewers ask this: Separating public account metadata from protected authentication data lets normal tools identify users without exposing password hashes.
Linux groups assign shared identities and permissions to sets of users.
- /etc/group normally records a group name, password placeholder, numeric GID, and a comma-separated list of supplementary members.
- A user's primary group is referenced by the GID in that user's /etc/passwd entry, so the user may not appear in the member list in /etc/group.
- id shows a user's UID, primary GID, and supplementary group memberships, usually with both numbers and names.
- groups prints the group names associated with the current user or a specified user.
Why interviewers ask this: Primary and supplementary groups provide a consistent way to grant shared access without assigning permissions separately to every user.
sudo runs an authorized command with another user's privileges, while su starts a shell or command as another user.
- sudo normally authenticates the invoking user and applies rules configured for that user.
- su commonly requires the target user's password and, without a command, opens a shell under the target identity.
- sudo can permit a narrow set of administrative commands and creates a clearer audit trail than sharing a root password.
- Least privilege means granting only the commands and access needed for a role, for no longer than necessary.
Why interviewers ask this: Using narrowly scoped sudo rules reduces the power available during routine administration compared with unrestricted root sessions.
A PID identifies a running process, and a PPID identifies the process that created or adopted it as its parent.
- The kernel assigns each process a numeric process ID called a PID.
- The parent process ID, or PPID, represents the process relationship used in the process hierarchy.
- ps displays a snapshot of processes and can show fields such as PID, PPID, user, state, CPU time, and command.
- Options such as ps -ef, ps aux, or ps -o pid,ppid,user,stat,command select different process sets and output formats.
Why interviewers ask this: PID and PPID values let administrators identify processes and understand their place in the process hierarchy.
A foreground job owns the terminal, while a background job runs without occupying the shell prompt.
- Adding & to a command starts it as a background job and returns the prompt immediately.
- jobs lists jobs tracked by the current shell, including their job numbers and states.
- bg resumes a stopped job in the background, commonly by referring to a job number such as %1.
- fg brings a background or stopped job into the foreground and reconnects it to the terminal.
Why interviewers ask this: Shell job control lets one terminal manage multiple commands while distinguishing shell job numbers from system process IDs.
Signals are asynchronous notifications sent to processes, and kill is a command for sending them.
- SIGTERM, signal 15, requests an orderly termination and can be handled so the process can clean up.
- SIGKILL, signal 9, ends a process immediately and cannot be caught, blocked, or ignored.
- SIGHUP, signal 1, historically reports a disconnected terminal and is also commonly used to request a configuration reload.
- kill uses SIGTERM by default, while a signal name or number can explicitly select another signal.
Why interviewers ask this: Different signals express different requests, so kill does not always mean immediate forced termination.
An exit status is an integer through which a command reports success or a type of failure to the shell.
- By convention, status 0 means success and a nonzero status means the command did not complete successfully.
- The special parameter $? expands to the exit status of the most recently completed command or pipeline.
- Running another command replaces the value represented by $?, so it should be read or saved promptly.
- Shell constructs such as &&, ||, and if use exit statuses to decide which command or branch runs next.
Why interviewers ask this: Exit statuses give scripts and interactive shells a standard way to make decisions based on command results.
Commands normally use three standard streams that the shell can connect to files or other commands.
- Standard input is file descriptor 0 and normally supplies data from the terminal.
- Standard output is file descriptor 1 for regular results, while standard error is file descriptor 2 for errors and diagnostics.
- Operators such as <, >, >>, and 2> redirect input, replace output, append output, or redirect errors.
- A pipe, |, connects the standard output of the command on the left to the standard input of the command on the right.
Why interviewers ask this: Separate streams and shell connections allow small commands to be combined while keeping normal results distinct from diagnostics.
A shell variable belongs to the current shell, while an environment variable is exported for inheritance by child processes.
- An assignment such as NAME=value creates or updates a variable in the current shell.
- export NAME or export NAME=value marks the variable for inclusion in the environment of subsequently started commands.
- Child processes inherit copies of exported values but do not receive unexported shell variables.
- A child process cannot directly change the variable or environment value stored in its parent shell.
Why interviewers ask this: Exporting defines which shell values cross the process boundary into programs launched from that shell.
Shell quoting and escaping control which characters are interpreted before arguments are passed to a command.
- Single quotes preserve every character inside them literally until the closing single quote.
- Double quotes preserve spaces and wildcard characters but still allow expansions such as variables and command substitution.
- A backslash removes the special meaning of the following character where the shell's quoting rules permit it.
- Unquoted glob patterns such as *.log are expanded by the shell to matching pathnames before the command runs.
Why interviewers ask this: Correct quoting determines whether the shell passes text literally or transforms it through expansion.
Locked questions
- 21
What are the shebang, executable bit, positional arguments, and exit status in a Bash script?
bashscripting - 22
What do apt update, apt install, apt remove, and apt upgrade do on Debian and Ubuntu?
packages - 23
What roles do DNF, YUM, and RPM have on RHEL-like Linux systems?
linuxpackagessystem-design - 24
What are package repositories, repository metadata, and package signatures?
- 25
What are systemd units and service units, and what do the basic systemctl service commands do?
linuxsystem-design - 26
How do systemctl enable and disable differ from starting and stopping a service?
linuxsystem-design - 27
What are systemd targets, and what do After, Requires, and Wants mean in unit dependencies?
dependencieslinuxsystem-design - 28
How can journalctl filter systemd journal entries by unit, boot, time, and priority?
linuxloggingsystem-design - 29
What are traditional files under /var/log, and what is the purpose of logrotate?
- 30
What do an IPv4 address, subnet prefix, and default gateway represent?
gatewaynetworkingip-addressing - 31
How do private, public, and loopback IPv4 addresses differ?
- 32
What are the basic differences between TCP and UDP, and where is each commonly used?
networkingprotocols - 33
What are ports and listening sockets, and how can they be viewed on Linux?
linux - 34
What does a DNS resolver do, and what information do A, AAAA, CNAME, MX, and PTR records store?
dnsnetwork-services - 35
What is a DHCP lease, and which core network parameters does DHCP normally provide?
network-services - 36
What is SSH, and how do server identity and user authentication fit into an SSH connection?
sshremote-accessauth - 37
How do public and private SSH user keys work, and what permissions should protect their files?
sshremote-accesspermissions - 38
What does sshd_config control, and which basic settings support safer SSH access?
sshremote-access - 39
What does a host firewall do, and how do stateful rules, UFW, and firewalld relate to it?
network-securitynetworking - 40
How is a user cron entry structured, and what should be known about its environment and output?
cronscheduling - 41
What is the basic difference between systemd timers and cron jobs?
linuxcronscheduling - 42
What are block devices and partitions, and what do lsblk and blkid show?
partitioning - 43
What do filesystem creation, mounting, and unmounting mean?
storage - 44
What fields does an /etc/fstab entry contain, and why is UUID commonly used?
primary-keys - 45
How do df and du differ, and what is inode exhaustion?
storage - 46
How do full and incremental backups differ, and what basic practices make backups reliable?
backupsbackup - 47
How does a tar archive differ from synchronization with rsync?
linuxbackup - 48
What is a hypervisor, and how do type 1 and type 2 hypervisors differ?
virtualization - 49
What resources make up a virtual machine, and what is the guest operating system?
system-designvirtualization - 50
How does a virtual machine snapshot differ from a backup?
backupsbackupvirtualization - 51
A systemd-managed web service fails to start after a reboot. How would you diagnose it?
linuxsystem-design - 52
A service reports a successful start but exits a few seconds later. What would you inspect?
- 53
You need to apply a configuration change to a production service. How would you do it safely?
config - 54
Users report that a server is slow and CPU usage may be high. How would you investigate?
- 55
A server shows high memory use and has begun using swap. How would you diagnose the pressure?
memory - 56
A process is unresponsive and must be stopped. How would you handle it?
concurrency - 57
A server is slow and you suspect disk I/O. How would you investigate with basic tools?
storage - 58
A filesystem is full. How would you find what consumed the space without scanning unrelated mounts?
storage - 59
A filesystem has free disk space, but applications cannot create new files. How would you check for inode exhaustion?
storage - 60
A mounted filesystem has suddenly become read-only. How would you respond?
storage - 61
A Linux server suddenly has no network connectivity. How would you diagnose it without changing configuration prematurely?
configlinux - 62
A server can no longer resolve hostnames. How would you prove whether DNS is the problem and investigate it?
dnsnetwork-services - 63
Users cannot reach a remote application's TCP port, although its host responds to ping. How would you locate the failure?
networkingprotocols - 64
An SSH connection either reports connection refused or waits until it times out. How would your investigation differ for these symptoms?
sshremote-access - 65
SSH reaches a server but public-key authentication is denied. How would you troubleshoot it safely?
sshremote-accessauth - 66
An NGINX-hosted site is unavailable after a change. What sequence would you use to find the cause?
web-server - 67
NGINX responds, but it serves the wrong website for one domain. How would you diagnose the virtual host selection?
web-server - 68
A Linux host configured for DHCP receives no address after boot. How would you investigate it?
configlinuxnetwork-services - 69
You must expose one new service through UFW or firewalld. How would you do it without opening more access than necessary?
network-securitynetworking - 70
Users report intermittent latency and packet loss to a Linux service. How would you gather useful evidence without causing additional risk?
latencytroubleshootinglinux - 71
A developer needs to restart one application service on a Linux server but must not receive full administrator access; how would you create the account and grant only the required privilege?
linux - 72
An employee leaves today, but their home directory contains project files the team may need; how would you disable access safely?
- 73
A Linux team needs a shared directory where new files remain accessible to team members but not to other users; how would you configure it?
configlinux - 74
A user receives Permission denied when opening /srv/projects/report/data.csv even though the file appears readable; how would you diagnose it?
permissions - 75
A maintenance script must be executable by the operations group but editable only by administrators; how would you install and permission it?
permissions - 76
You discover that a configuration file was accidentally changed to mode 777; how would you correct it without guessing?
config - 77
A new employee sends you an SSH public key for access to a Linux server; how would you onboard it safely?
sshlinuxremote-access - 78
A user who logged in yesterday now receives an account locked or expired message; how would you investigate and restore access if authorized?
- 79
A scan shows an unexpected TCP port listening on a Linux server; how would you identify the service and reduce exposure?
networkingprotocolslinux - 80
You are assigned routine security updates for a Linux server; how would you apply them safely and decide whether a reboot is needed?
linux - 81
You need to archive application logs older than 14 days without touching active logs or overwriting an existing archive. How would you write and test the Bash script?
bashscripting - 82
A Bash maintenance script accepts a target directory and a mode, then runs several commands. How would you make its input handling and failure behavior reliable for scheduled use?
scripting - 83
You must schedule /opt/acme/bin/backup.sh every day at 02:15 with cron. What cron setup would you use so it has a predictable environment, records output, and cannot overlap?
backupsbackupcron - 84
A backup command succeeds in your shell but its cron job produces no backup. How would you diagnose the difference without immediately rewriting the script?
backupsbackupcron - 85
An application starts with /opt/widget/bin/widget-server and must run continuously from /opt/widget as a non-root account. What basic systemd service unit would you create and how would you verify it?
linuxsystem-design - 86
A systemd-managed application needs database settings and an API token, and its unit file has just changed. How would you supply the values and apply the change safely?
linuxapidatabase - 87
An application writes continuously to /var/log/widget/app.log as user widget. How would you configure logrotate so logs are retained and compressed without causing the application to keep writing to an old file?
config - 88
Given a large text access log where the client address is field 1 and HTTP status is field 9, how would you find the most frequent error statuses and the client addresses producing them?
http - 89
Monitoring reports repeated failed SSH logins on a Linux server. How would you investigate who, when, and from where while preserving enough context for escalation?
monitoringsshlinux - 90
You need a small Ansible playbook that installs nginx and ensures it starts now and after reboot on several Debian hosts. How would you implement and verify it idempotently?
ansibleautomationidempotency - 91
A new empty disk has been attached to a Linux server and must hold application data. How would you prepare and mount it safely?
storagelinux - 92
The new filesystem works when mounted manually, and you now need it to survive a reboot. What would you do?
storage - 93
A filesystem that should be mounted is absent after startup. How would you diagnose the failure without risking its data?
storage - 94
You need a basic recurring copy of /srv/data to another mounted filesystem using rsync. How would you set it up safely?
storagelinuxbackup - 95
A backup job reports success, and you are asked to demonstrate that files can actually be restored. What would you do?
backupsbackup - 96
A user needs one directory restored from a large tar archive, but unrelated live paths must not be overwritten. How would you proceed?
- 97
Your team has daily backups, but nobody has recently checked whether they are usable. What verification routine would you propose?
backupsbackup - 98
A virtual machine boots normally but cannot reach any network resource. How would you narrow down the fault?
virtualization - 99
A virtual machine reports that its root filesystem is nearly full. How would you respond if more capacity may be needed?
capacitystoragevirtualization - 100
Users report that a production server is extremely slow and sometimes unresponsive. Give your systematic first-pass triage.
system-design