Quiz: System Administration Essentials
Test your understanding of user management, services, and system administration.
1. What does useradd do?
- Adds a USB device
- Creates a new user account
- Adds a user to a group
- Increases user privileges
Show Answer
The correct answer is B. useradd creates a new user account. For example, sudo useradd -m -s /bin/bash newuser creates a user with a home directory (-m) and bash shell (-s). Use passwd to set their password.
Concept Tested: User Management
2. What is systemd?
- A system debugger
- The init system and service manager for modern Linux
- A disk formatter
- A system monitoring tool
Show Answer
The correct answer is B. systemd is the init system for most modern Linux distributions. It manages the boot process, starts and stops services (daemons), and handles system state. It replaced older init systems like SysV init.
Concept Tested: Systemd
See: Chapter 23 - Systemd
3. What does systemctl start nginx do?
- Installs nginx
- Starts the nginx service
- Stops the nginx service
- Restarts the computer
Show Answer
The correct answer is B. systemctl start nginx starts the nginx service (web server). Other common commands: stop (stop service), restart (stop then start), status (check if running), enable (start at boot).
Concept Tested: Systemctl Commands
4. What does systemctl enable nginx do?
- Starts nginx immediately
- Configures nginx to start automatically at boot
- Enables advanced nginx features
- Allows network access to nginx
Show Answer
The correct answer is B. systemctl enable configures a service to start automatically when the system boots. It creates symlinks in the systemd target directories. Use disable to prevent auto-start.
Concept Tested: Service Auto-start
5. What file contains encrypted user passwords?
- /etc/passwd
- /etc/shadow
- /etc/passwords
- /etc/users
Show Answer
The correct answer is B. /etc/shadow contains encrypted (hashed) passwords. It's only readable by root for security. /etc/passwd contains user account info but no longer stores passwords (they're replaced with 'x').
Concept Tested: Password Storage
6. What does the usermod command do?
- Changes the user's mode
- Modifies user account properties
- Moderates user activity
- Moves user files
Show Answer
The correct answer is B. usermod modifies existing user accounts. Common uses: usermod -aG sudo username (add to group), usermod -s /bin/zsh username (change shell), usermod -L username (lock account).
Concept Tested: User Modification
7. What is the purpose of the journalctl command?
- Manages disk journaling
- Views systemd journal logs
- Creates journal entries
- Journals file changes
Show Answer
The correct answer is B. journalctl queries and displays logs from the systemd journal. Use journalctl -u nginx for a specific service, journalctl -f to follow logs in real-time, or journalctl -b for current boot only.
Concept Tested: System Logs
8. What does the boot process start with on modern Linux systems?
- The kernel loads first, then BIOS
- BIOS/UEFI → Bootloader → Kernel → systemd
- systemd starts everything
- The shell loads first
Show Answer
The correct answer is B. The boot sequence: BIOS/UEFI initializes hardware → bootloader (GRUB) loads the kernel → kernel initializes and starts systemd (PID 1) → systemd starts all other services and brings up the system.
Concept Tested: Boot Process
9. What command adds a user to a group?
- groupadd user group
- usermod -aG groupname username
- addgroup user to group
- chgrp user groupname
Show Answer
The correct answer is B. usermod -aG groupname username adds the user to the specified group. The -a means append (don't remove from other groups), and -G specifies supplementary groups.
Concept Tested: Group Management
10. What does passwd command do without arguments?
- Shows password policy
- Changes your own password
- Resets all passwords
- Displays encrypted passwords
Show Answer
The correct answer is B. Running passwd without arguments lets you change your own password. As root, passwd username changes another user's password. It prompts for the new password twice to confirm.
Concept Tested: Password Management