Linux System Administration 5 — Questions and Answers
Question 1: Which command updates the initramfs image on an Ubuntu/Debian system?
- mkinitrd
- update-initramfs -u (Correct answer)
- dracut --force
- grub-mkconfig
Correct answer: update-initramfs -u
`update-initramfs -u` rebuilds the initramfs for the current kernel on Debian-based systems.
Question 2: What is the purpose of the `chroot` command?
- Change ownership of the root directory
- Change the apparent root directory for a process (Correct answer)
- Grant root privileges to a specified user
- Reset root password from recovery mode
Correct answer: Change the apparent root directory for a process
`chroot` runs a command with a specified directory as the apparent filesystem root, isolating it from the real root.
Question 3: Which file controls the maximum number of open file descriptors system-wide on a Linux system?
- /etc/security/limits.conf
- /proc/sys/fs/file-max (Correct answer)
- /etc/sysctl.conf (fs.nr_open)
- /sys/kernel/file-max
Correct answer: /proc/sys/fs/file-max
`/proc/sys/fs/file-max` holds the system-wide maximum number of open file descriptors the kernel allows.
Question 4: You need to zero out a disk before decommissioning it securely. Which command is appropriate?
- shred -vz /dev/sdX (Correct answer)
- dd if=/dev/zero of=/dev/sdX bs=1M
- mkfs.ext4 /dev/sdX
- fdisk -z /dev/sdX
Correct answer: shred -vz /dev/sdX
`shred -vz` overwrites the device multiple times and then zeros it, making data recovery very difficult.
Question 5: What does `ss -s` display?
- A summary of socket statistics by protocol (Correct answer)
- All established SSH sessions
- SSL certificate details for all connections
- System security audit log
Correct answer: A summary of socket statistics by protocol
`ss -s` prints a summary showing the total number of sockets broken down by type and state.
Question 6: Which command would you use to check the SMART status of a hard drive `/dev/sda`?
- hdparam -S /dev/sda
- smartctl -a /dev/sda (Correct answer)
- iostat -d /dev/sda
- badblocks -v /dev/sda
Correct answer: smartctl -a /dev/sda
`smartctl -a` from the `smartmontools` package reads and displays all SMART data for the specified drive.
Question 7: What is the function of `PAM` (Pluggable Authentication Modules) in Linux?
- A package manager for authentication software
- A flexible framework that decouples authentication from application logic (Correct answer)
- A daemon that caches authentication tokens
- An encryption module for PAM-aware password files
Correct answer: A flexible framework that decouples authentication from application logic
PAM provides a centralized, configurable authentication framework so applications don't need to implement auth directly.
Which command updates the initramfs image on an Ubuntu/Debian system?