Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Chapter 27Name in the book: Theoretical Pre-Assessment Exam

Test yourself before the exam

Before the practical practice exams, check if you know what to do for each kind of task. For every question, say the steps and the main commands out loud — then compare with the short answer. Any question you cannot answer shows a chapter to repeat.

  • 5 Lessons
  • 27 Commands
  • 2 Labs

$ run as a normal user# run as root (or with sudo)

27.1

Users, groups and permissions

Questions about accounts, rights and shared folders.

TaskShort answer
Create a folder where all members of sales share files, new files get the group, and people cannot delete each other's fileschgrp sales DIR, chmod 3770 DIR (SGID + sticky) — lesson
User lisa must change her password every 60 dayschage -M 60 lisa — lesson
All new users must get a file in their home folderPut it in /etc/skel — lesson
Group webadmins may restart httpd as root, nothing elseFile in /etc/sudoers.d/ with visudo -f — lesson
Give user carol read access to one file without changing owner or groupsetfacl -m u:carol:r FILE — lesson

27.2

Storage

Partitions, LVM, swap and mounts.

TaskShort answer
Create an LV of 500 MiB named my_lv with extents of 8 MiB, ext4, mounted on /data at bootpvcreate, vgcreate -s 8M, lvcreate -n my_lv -L 500M, mkfs.ext4, fstab line, mount -a — lesson
Make an XFS LV 1 GiB bigger while it is mountedlvextend -r -L +1G — lesson
Add 1 GiB of swap that is active after rebootPartition or LV, mkswap, fstab swap line, swapon -a — lesson
Mount a file system by UUID at bootblkid for the UUID, fstab UUID=… line — lesson
Home folders of NFS users must appear under /home/remote when usedautofs wildcard map * -rw server:/path/& — lesson

27.3

Software, services and scheduling

Repositories, services, boot and jobs.

TaskShort answer
Install software from a repository at a given URL.repo file with baseurl, then dnf install — lesson
A service must run now and after every rebootsystemctl enable --now SERVICE — lesson
The system must boot into text modesystemctl set-default multi-user.target — lesson
User anna runs a command every weekday at 14:23crontab -e -u anna: 23 14 * * 1-5 COMMAND — lesson
The journal must survive rebootsStorage=persistent in a journald drop-in, restart journald — lesson
Set the recommended tuned profiletuned-adm recommend, then tuned-adm profile NAME — lesson

27.4

Network and security

Network settings, SSH, firewall, SELinux, time.

TaskShort answer
Set a fixed IPv4 address, gateway and DNS persistentlynmcli con mod … ipv4.method manual …, nmcli con up — lesson
Change the host name persistentlyhostnamectl set-hostname NAME — lesson
Run Apache with a document root in /webConfig + semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?" + restorecon -Rv /web — lesson
Let sshd listen on port 2022sshd drop-in, semanage port -a -t ssh_port_t, firewall-cmd --add-port — lesson
Open the http service in the firewall for goodfirewall-cmd --add-service=http --permanent, --reload — lesson
Sync time from time.example.comserver time.example.com iburst in chrony.conf, restart chronyd — lesson

27.5

Boot and repair

Getting into a broken system.

TaskShort answer
Reset the unknown root passwordrd.break, remount /sysroot rw, chroot, passwd, touch /.autorelabel — lesson
The system stops in emergency mode after an fstab changemount -o remount,rw /, fix fstab, mount -a, reboot — lesson
Remove rhgb quiet from the kernel linegrubby --update-kernel=ALL --remove-args="rhgb quiet" — lesson
Make a module load at every bootFile in /etc/modules-load.d/ — lesson

Remember

When you can answer every row, do the practice exams below — on clean VMs, in the time limit, and reboot at the end before you check.

Practice

All commands in this chapter