CompTIA Linux+ (XK0-006)System ManagementEasy
A server administrator wants a headless Linux server to always boot into a non-graphical, multi-user command-line environment by default. Which command accomplishes this?
- Asystemctl set-default multi-user.target
- Bsystemctl isolate graphical.target
- Csystemctl enable rescue.target
- Dsystemctl mask multi-user.target
Show answer & explanationAnswer & explanation
Correct answer: A. systemctl set-default multi-user.target
systemd replaced runlevels with targets. multi-user.target is the equivalent of old runlevel 3 (text-mode, networking, no GUI), and set-default creates a symlink making it the default boot target.
Why the other options are wrong
- B. graphical.target starts a GUI, the opposite of what is needed.
- C. rescue.target is single-user maintenance mode, not normal operation.
- D. Masking multi-user.target would prevent it from starting at all.
systemd Targets
Targets are systemd's replacement for SysV runlevels, grouping units into a desired system state such as text-mode or graphical.
- multi-user.target ≈ old runlevel 3
- graphical.target ≈ old runlevel 5
- systemctl set-default <target> persists the choice via symlink
Memory trick: 'Multi-user is the plain office desk; graphical is the office with a TV.'