RHCSA RHCSA Linux System Administration 3 — Questions and Answers
Question 1: Which command schedules a one-time job to run at 2:30 PM today using the 'at' utility?
- at 14:30 (Correct answer)
- at 2:30 PM
- cron 14:30
- atd 14:30 today
Correct answer: at 14:30
The 'at' command accepts 24-hour time directly; after entering the command, you type your job and press Ctrl+D.
Question 2: What does the 'ss -tulnp' command display?
- TCP and UDP listening sockets with process info and no DNS resolution (Correct answer)
- All established TCP connections with DNS names
- Summary statistics for all sockets
- Only UNIX domain sockets
Correct answer: TCP and UDP listening sockets with process info and no DNS resolution
-t=TCP, -u=UDP, -l=listening, -n=no DNS, -p=process; combined they show listening network sockets with PIDs.
Question 3: A filesystem mounted at /data is running low on space. The underlying LV is in vg0. Which command extends it by 10GB?
- lvextend -L +10G /dev/vg0/data && xfs_growfs /data (Correct answer)
- lvcreate -L +10G /dev/vg0/data
- vgextend -L +10G /dev/vg0/data
- lvresize -L 10G /dev/vg0/data
Correct answer: lvextend -L +10G /dev/vg0/data && xfs_growfs /data
lvextend grows the LV and xfs_growfs expands the XFS filesystem online to fill the new space.
Question 4: Which file should be edited to set a system-wide default umask for all users?
- /etc/profile (Correct answer)
- /etc/passwd
- /etc/shadow
- /etc/login.defs only
Correct answer: /etc/profile
/etc/profile is sourced for all login shells and is the standard place to set a system-wide umask.
Question 5: How do you set the hostname to 'webserver01.example.com' persistently using a single command?
- hostnamectl set-hostname webserver01.example.com (Correct answer)
- hostname webserver01.example.com
- echo webserver01.example.com > /etc/hostname
- nmcli general hostname webserver01.example.com
Correct answer: hostnamectl set-hostname webserver01.example.com
hostnamectl set-hostname updates /etc/hostname and applies the change immediately and persistently.
Question 6: Which command lists all enabled systemd services that start at boot in the default target?
- systemctl list-unit-files --type=service --state=enabled (Correct answer)
- systemctl list-units --type=service
- systemctl status --all --type=service
- systemctl show --type=service --enabled
Correct answer: systemctl list-unit-files --type=service --state=enabled
--state=enabled filters unit files to only show those enabled to start automatically.
Question 7: What is the correct NFS mount entry in /etc/fstab to mount 192.168.1.10:/exports/data at /mnt/data with read-write and auto-mount?
- 192.168.1.10:/exports/data /mnt/data nfs rw,_netdev 0 0 (Correct answer)
- 192.168.1.10:/exports/data /mnt/data nfs4 defaults 0 0
- /mnt/data 192.168.1.10:/exports/data nfs rw 0 0
- 192.168.1.10:/exports/data /mnt/data nfs noauto 0 0
Correct answer: 192.168.1.10:/exports/data /mnt/data nfs rw,_netdev 0 0
_netdev tells systemd to mount after network is available, which is required for network filesystems.
Which command schedules a one-time job to run at 2:30 PM today using the 'at' utility?