RHCSA RHCSA Linux System Administration 4 — Questions and Answers
Question 1: Which command searches for all SUID binaries on the entire filesystem?
- find / -perm -4000 -type f 2>/dev/null (Correct answer)
- find / -perm 4000 -type f
- ls -lR / | grep 'rws'
- stat -c '%a %n' / | grep 4
Correct answer: find / -perm -4000 -type f 2>/dev/null
-perm -4000 matches files where the SUID bit is set regardless of other permission bits.
Question 2: A cron job must run every 15 minutes. Which crontab expression is correct?
- */15 * * * * /script.sh (Correct answer)
- 15 * * * * /script.sh
- 0,15 * * * * /script.sh
- * */15 * * * /script.sh
Correct answer: */15 * * * * /script.sh
*/15 in the minute field means 'every 15 minutes' (0, 15, 30, 45).
Question 3: You need to configure autofs to automatically mount NFS shares under /misc. Which file controls the autofs master map?
- /etc/auto.master (Correct answer)
- /etc/autofs.conf
- /etc/auto.misc
- /etc/fstab
Correct answer: /etc/auto.master
/etc/auto.master (or auto.master.d/) is the top-level map that points to indirect map files like /etc/auto.misc.
Question 4: Which command checks and repairs an ext4 filesystem on /dev/sdb1 (must be unmounted)?
- fsck.ext4 -y /dev/sdb1 (Correct answer)
- fsck /dev/sdb1 --repair
- e2fsck -n /dev/sdb1
- tune2fs -c /dev/sdb1
Correct answer: fsck.ext4 -y /dev/sdb1
fsck.ext4 -y automatically answers yes to all repair prompts; the filesystem must be unmounted first.
Question 5: A process with PID 1234 is unresponsive. Which signal forcefully terminates it?
- kill -9 1234 (Correct answer)
- kill -15 1234
- kill -1 1234
- kill -2 1234
Correct answer: kill -9 1234
Signal 9 (SIGKILL) cannot be caught or ignored by the process and immediately terminates it.
Question 6: Which command displays real-time I/O statistics per block device every 2 seconds?
- iostat -xz 2 (Correct answer)
- vmstat -d 2
- iotop -b 2
- blkstat 2
Correct answer: iostat -xz 2
iostat -x shows extended statistics per device and -z suppresses devices with no activity; the interval is 2 seconds.
Question 7: What is the purpose of the 'sticky bit' when set on a directory like /tmp?
- Only the file owner or root can delete files within the directory (Correct answer)
- Files in the directory are kept in memory for faster access
- The directory cannot be deleted by any user
- All files inherit the directory's permissions
Correct answer: Only the file owner or root can delete files within the directory
The sticky bit on a directory restricts deletion so that only the file's owner or root can remove it.
Which command searches for all SUID binaries on the entire filesystem?