Chapter 9
Completely disable a service from being started, both manually and at boot
*systemctl mask network*
Reload configuration file of a running sshd service
*systemctl reload sshd.service*
Stop, then start, the sshd service in a single command
*systemctl restart sshd.service*
Set the default target to graphical.target
*systemctl set-default graphical.target*
Display the status of the *chronyd* service
*systemctl status chronyd*
Investigate any units which are in a failed or maintenance state. Show the full output
*systemctl status rngd.service -l*
View the status of a sshd service
*systemctl status sshd.service*
Stop the sshd service
*systemctl stop sshd.service*
Make a masked service available
*systemctl unmask network*
Query the state of all units to verify a system startup
*systemctl*
What will you append to the end of the line starting with *linux16* to get into the emergency target?
*systemd.unit=emergency.target*
What will you add to the end of the line starting with linux16 after pressing *e* to edit the current entry to set the target to rescue target?
*systemd.unit=rescue.target*
Make sure that all unlabeled files (including /etc/shadow at this point) get relabeled during boot
*touch /.autorelabel*
List units which are required and wanted by the sshd service
*systemctl list-dependencies sshd.service*
List the enabled or disabled states of all service units
*systemctl list-unit-files --type=service*
View all targets installed on disk
*systemctl list-unit-files --type=target --all*
Start the sshd service
*systemctl start sshd.service*
List all socket units, active and inactive, on the system
*systemctl list-units --type=socket --all*
View all available targets
*systemctl list-units --type=target --all*
List all service units on the system
*systemctl list-units --type=service*
Switch into a chroot jail, where /sysroot is treated as the root of the file system tree
*chroot /sysroot*
Make changes to the boot loader configuration permanent
*grub2-mkconfig > /boot/grub2/grub.cfg*
Mount all filesystems mentioned in fstab
*mount -a*
Mount the root file system read-write
*mount -o remount,rw /*
Remount /sysroot as read-write
*mount -o remount,rw /sysroot*
Confirm that the listed daemons are running using PID
*ps -p PID*
Display the status of the sshd service
*sudo systemctl status sshd*
View only failed services
*systemctl --failed --type=service*
Query the state of only the service units
*systemctl --type=service*
Disable a sshd service from starting at boot time
*systemctl disable sshd.service*
Configure a sshd service to start at boot time
*systemctl enable sshd.service*
Get the name of the default target
*systemctl get-default*
Determine if sshd is active
*systemctl is-active sshd*
Determine if the sshd service is active without displaying all of the status information
*systemctl is-active sshd*
Determine if the chronyd service is enabled to start at system boot
*systemctl is-enabled chronyd*
Determine if the sshd service is enabled to start at system boot
*systemctl is-enabled sshd*
Show if sshd is enabled to start at boot time
*systemctl is-enabled sshd*
Switch to a multi-user target
*systemctl isolate multi-user.target*
List dependencies for graphical target
*systemctl list-dependencies graphical.target | grep target*
View the enabled and disabled settings for all units
*systemctl list-unit-files*
List the active state of all loaded units and add the option to show inactive units too
*systemctl list-units --all*