هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
Shell, help and files
Questions about the command line, the documentation and file work.
| Task | Short answer |
|---|---|
| Find the admin command that changes a user, when you only know the word "user" | man -k user | grep '(8)' — lesson |
Read the file format of /etc/passwd, not the command | man 5 passwd — lesson |
| Run the last command again as root | sudo !! — lesson |
Make the folders docs, src and tests inside project in one command | mkdir -p project/{docs,src,tests} — lesson |
Copy /etc/ssh with owners, rights and SELinux labels | cp -a /etc/ssh /root/ssh-backup — lesson |
Make weblogs in your home folder point to /var/log/httpd | ln -s /var/log/httpd ~/weblogs — lesson |
Find files bigger than 100 MiB in /var | find /var -type f -size +100M — lesson |
Replace every foo by bar in a file in vim | :%s/foo/bar/g — lesson |
| Save the output and the errors of a script in a log, adding to the end | script.sh >> run.log 2>&1 — lesson |
| Show a command's output on the screen and save it in a file | cmd | tee file.txt — lesson |
Users, groups and rights
Accounts, sudo, permissions and shared folders.
| Task | Short answer |
|---|---|
Create user omar with the extra group wheel | useradd -G wheel omar, then passwd omar — lesson |
Add anna to webteam without removing her other groups | usermod -aG webteam anna — lesson |
The group webteam may only restart httpd with sudo | File in /etc/sudoers.d/ with visudo -f: %webteam ALL=(root) /usr/bin/systemctl restart httpd — lesson |
anna must change her password every 90 days | chage -M 90 anna — lesson |
| Force a new password at the next login | chage -d 0 omar — lesson |
| A script may be run by its owner and group only | chmod 750 script.sh — lesson |
New files in /srv/sales must get the group sales, nobody may delete files of others | chgrp sales /srv/sales; chmod 3770 /srv/sales — lesson |
New files of a user must be 640 | umask 027 in ~/.bashrc — lesson |
Software, media, processes and services
Packages, removable media and the running system.
| Task | Short answer |
|---|---|
| Register a server with an activation key | rhc connect --organization ID --activation-key KEY — lesson |
Find which package gives the command dig | dnf provides '*/bin/dig' — lesson |
| Undo the last DNF install | dnf history, then dnf history undo ID — lesson |
Which package owns /etc/ssh/sshd_config? | rpm -qf /etc/ssh/sshd_config — lesson |
| Install a desktop app only for yourself | flatpak install --user REMOTE APP-ID — lesson |
| Read an ISO file | mount -o loop,ro FILE.iso /mnt/iso — lesson |
umount says "target is busy" | lsof /mnt/usb or fuser -vm /mnt/usb, close it, try again — lesson |
| Show the 5 processes that use the most CPU | ps aux --sort=-%cpu | head -6 — lesson |
A process ignores kill PID | kill -9 PID (SIGKILL) — lesson |
| httpd must run now and after every reboot | systemctl enable --now httpd — lesson |
| A service must never start, also not by another unit | systemctl mask --now SERVICE — lesson |
| Find why a service failed | systemctl status SERVICE, journalctl -u SERVICE -n 50 — lesson |
Network and SSH
Addresses, names and remote access.
| Task | Short answer |
|---|---|
| Show all cards and addresses in short | ip -br a — lesson |
| Which program listens on port 80? | ss -tlpn | grep ':80 ' — lesson |
Give enp1s0 the fixed address 192.168.122.10/24, gateway and DNS .1 | nmcli con mod enp1s0 ipv4.method manual ipv4.addresses 192.168.122.10/24 ipv4.gateway 192.168.122.1 ipv4.dns 192.168.122.1, nmcli con up enp1s0 — lesson |
| Add a second address and keep the first | nmcli con mod enp1s0 +ipv4.addresses ADDR/PREFIX — lesson |
Set the host name to server1.example.com | hostnamectl hostname server1.example.com — lesson |
server2 must be found by name without DNS | Line in /etc/hosts: 192.168.122.20 server2.example.com server2 — lesson |
| Log in to server2 without a password | ssh-keygen -t ed25519, ssh-copy-id student@server2 — lesson |
| root must not log in over SSH | PermitRootLogin no in /etc/ssh/sshd_config.d/50-hardening.conf, sshd -t, systemctl reload sshd — lesson |
Plan your next step
RH124 is the base. The next course, RH134, adds automation, storage, SELinux, boot repair, containers and image mode. Together they cover the RHCSA exam.
| If you want to … | Go to |
|---|---|
| Go on with the second course | RH134: Write shell scripts |
| Check yourself against the RHCSA exam objectives | The RHCSA summary |
| Practise every topic with a task and a solution | All labs |
| Look up any command with all its options | Commands |
في العمل
Repeat the review lab after a week, on a new machine, against the clock. Speed comes from doing the tasks again and again — not from reading.