Docsity

Linux Operating System Security Practice Exam.d, Exams of Cybercrime, Cybersecurity and Data Privacy

Toggle sidebar
bg1
Linux Operating System Security Practice Exam
Total Questions: 70
Format: Multiple Choice (A, B, C, D) with Verified Answers & Rationales
Section 1: User Account & Authentication Security
1. Which file securely stores local Linux user password hashes with restricted
permissions readable only by root?
A) /etc/passwd
B) /etc/group
C) /etc/shadow
D) /etc/security/limits.conf
Correct Answer: C) /etc/shadow
Rationale: The /etc/shadow file holds encrypted password hashes along with password
expiration information, restricting read access exclusively to elevated privilege accounts
(root) to prevent offline password cracking.
2. Which command is used to locked an existing local Linux user account by prepending
an exclamation mark to its encrypted password in /etc/shadow?
A) usermod -L username
B) userdel -r username
C) passwd -u username
D) chage -E 0 username
Correct Answer: A) usermod -L username
Rationale: The usermod -L (lock) option disables a user password by prepending an
exclamation point (!) to the password hash in /etc/shadow, preventing authentication while
preserving the account configuration.
3. Which Pluggable Authentication Module (PAM) control flag directs the PAM stack to
immediately return success if the module succeeds, without calling subsequent modules
in that stack?
A) required
B) requisite
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Linux Operating System Security Practice Exam.d and more Exams Cybercrime, Cybersecurity and Data Privacy in PDF only on Docsity!

Linux Operating System Security Practice Exam

Total Questions: 70 Format: Multiple Choice (A, B, C, D) with Verified Answers & Rationales

Section 1: User Account & Authentication Security

1. Which file securely stores local Linux user password hashes with restricted permissions readable only by root? A) /etc/passwd B) /etc/group C) /etc/shadow D) /etc/security/limits.conf Correct Answer: C) /etc/shadow Rationale: The /etc/shadow file holds encrypted password hashes along with password expiration information, restricting read access exclusively to elevated privilege accounts (root) to prevent offline password cracking. 2. Which command is used to locked an existing local Linux user account by prepending an exclamation mark to its encrypted password in /etc/shadow? A) usermod -L username B) userdel -r username C) passwd -u username D) chage -E 0 username Correct Answer: A) usermod -L username Rationale: The usermod -L (lock) option disables a user password by prepending an exclamation point (!) to the password hash in /etc/shadow, preventing authentication while preserving the account configuration. 3. Which Pluggable Authentication Module (PAM) control flag directs the PAM stack to immediately return success if the module succeeds, without calling subsequent modules in that stack? A) required B) requisite

C) optional D) sufficient Correct Answer: D) sufficient Rationale: If a module designated as 'sufficient' succeeds and no previous 'required' module has failed, PAM immediately returns success to the application, skipping remaining checks.

4. Which configuration directive in /etc/security/pwquality.conf enforces a minimum required character length for newly set local passwords? A) maxlen B) minlen C) lcredit D) dcredit Correct Answer: B) minlen Rationale: The minlen parameter in pam_pwquality configuration sets the baseline length constraint for newly created or updated passwords. 5. What configuration file dictates privilege escalation rules and command execution permissions managed by the sudo utility? A) /etc/sudo.conf B) /etc/sudoers C) /etc/security/access.conf D) /etc/pam.d/sudo Correct Answer: B) /etc/sudoers Rationale: The /etc/sudoers file defines which users and groups are allowed to execute specific administrative commands with elevated rights. 6. Which command allows administrators to safely edit and syntax-check the /etc/sudoers configuration file? A) nano /etc/sudoers B) vim /etc/sudoers C) ed /etc/sudoers D) visudo Correct Answer: D) visudo Rationale: visudo opens the sudoers file in a safe mode, locking the file against concurrent

home directory path, and skeleton files) defined? A) /etc/default/useradd B) /etc/login.access C) /etc/environment D) /etc/profile Correct Answer: A) /etc/default/useradd Rationale: /etc/default/useradd contains default values for parameters used by the useradd utility when creating new system user accounts.

Section 2: File System Security, Permissions & Access Controls

11. What absolute symbolic numeric permission setting corresponds to read, write, and execute for the owner; read and execute for the group; and no access for others? A) 640 B) 755 C) 750 D) 700 Correct Answer: C) 750 Rationale: Owner = 4+2+1=7 (rwx); Group = 4+0+1=5 (r-x); Others = 0+0+0=0 (---), yielding octal representation 750. 12. What special permission bit ensures that files created inside a directory inherit the directory's group ownership rather than the creating user's primary group? A) SGID (Set Group ID) B) SUID (Set User ID) C) Sticky Bit D) Immutable Flag Correct Answer: A) SGID (Set Group ID) Rationale: Applying the SGID bit (chmod g+s) to a directory forces all newly created files and subdirectories within it to inherit the parent directory's group ownership. 13. Which command sets the sticky bit on a shared directory such as /tmp to prevent users from deleting files owned by others? A) chmod 4777 /tmp B) chmod 2777 /tmp C) chmod 0777 /tmp

D) chmod 1777 /tmp Correct Answer: D) chmod 1777 /tmp Rationale: The octal digit 1 in 1777 represents the sticky bit (+t), which restricts file deletion and renaming in public directories solely to the file owner or root.

14. If a default umask value is set to 027, what default permissions are assigned to a newly created text file (base permissions 666)? A) 750 B) 640 C) 660 D) 644 Correct Answer: B) 640 Rationale: Base file permission 666 (rw-rw-rw-) minus umask 027 (---w-rwx) results in 640 (rw-r-----). 15. Which chattr command option prevents a file from being modified, deleted, renamed, or linked, even by the root user? A) chattr +a filename B) chattr +i filename C) chattr +s filename D) chattr +u filename Correct Answer: B) chattr +i filename Rationale: The +i (immutable) attribute prevents any modification, renaming, deletion, or hard-link creation against the target file until removed by root (chattr -i). 16. Which command is used to display POSIX Access Control Lists (ACLs) associated with a specific file or directory? A) ls -l B) chmod --show-acl C) stat --acl D) getfacl Correct Answer: D) getfacl Rationale: getfacl displays file names, owners, groups, and extended Access Control List permissions for targeted file system objects.

C) find / -name "*.suid" D) ls -la / --suid Correct Answer: B) find / -perm -4000 -type f Rationale: In find syntax, octal permission mask -4000 specifically targets regular files (- type f) that have the SUID bit set.

Section 3: Mandatory Access Control (SELinux & AppArmor)

21. What command displays the current operational mode of SELinux (Enforcing, Permissive, or Disabled)? A) selinux-status B) checkenforce C) getenforce D) getsebool -a Correct Answer: C) getenforce Rationale: getenforce outputs the current execution state of SELinux directly to stdout. 22. What occurs when SELinux is set to Permissive mode? A) Access control violations are logged, but policy rules are not enforced B) All access checks are completely turned off and no logs are generated C) Security policies strictly block unauthorized system calls D) The kernel runs without loading security modules Correct Answer: A) Access control violations are logged, but policy rules are not enforced Rationale: In Permissive mode, SELinux monitors operations and records AVC audit denials to security logs without actively denying or blocking operations. 23. Which utility is used to modify the default security context stored in SELinux policy files for a directory tree? A) chown B) chcon C) chmod D) semanage fcontext Correct Answer: D) semanage fcontext Rationale: semanage fcontext updates persistent file context mapping databases, ensuring

changes survive system relabeling procedures (unlike temporary chcon modifications).

24. Which command restores file security contexts based on current system SELinux policy rules? A) restorecon B) setenforce 1 C) fixfiles clean D) chcon --reset Correct Answer: A) restorecon Rationale: restorecon evaluates files against system SELinux policies and resets misconfigured target security labels to default specifications. 25. Which command lists and toggles SELinux boolean configuration switches without modifying policy code directly? A) setenforce / getenforce B) setsebool / getsebool C) getfacl / setfacl D) apparmor_status / aa-complain Correct Answer: B) setsebool / getsebool Rationale: getsebool displays boolean policy states, while setsebool (with -P for persistence) alters operational runtime features of SELinux services. 26. Which command places an AppArmor security profile into non-enforcing learning/complain mode? A) aa-enforce B) aa-disable C) aa-complain D) aa-status Correct Answer: C) aa-complain Rationale: aa-complain sets AppArmor profiles to monitor and log policy violations without actively preventing restricted actions. 27. Where are AppArmor security profile definitions stored on a Debian/Ubuntu system? A) /etc/apparmor.d/

restriction failures within /var/log/audit/audit.log.

Section 4: Network Security, Firewalls & Hardening SSH

31. Which command adds a permanent rule in Firewalld to open incoming TCP port 443 in the public zone? A) iptables -A INPUT -p tcp --dport 443 -j ACCEPT B) ufw allow 443/tcp C) firewall-cmd --zone=public --add-port=443/tcp --permanent D) nft add rule inet filter input tcp dport 443 accept Correct Answer: C) firewall-cmd --zone=public --add-port=443/tcp --permanent Rationale: firewall-cmd with --add-port and --permanent ensures port 443 configuration persists across daemon reloads and system reboots. 32. Which Uncomplicated Firewall (UFW) command syntax allows incoming connections from a specific subnet (192.168.1.0/24)? A) ufw allow from 192.168.1.0/ B) ufw add 192.168.1.0/24 accept C) iptables -in 192.168.1.0/24 allow D) ufw enable network 192.168.1.0/ Correct Answer: A) ufw allow from 192.168.1.0/ Rationale: The UFW syntax 'ufw allow from [subnet]' grants full ingress access rights to network traffic originating from the specified IP block. 33. Which SSH configuration setting forces SSH logins to require public key verification and reject simple password entry? A) KeyAuthentication yes B) RSAAuthentication required C) DisablePasswords yes D) PasswordAuthentication no Correct Answer: D) PasswordAuthentication no Rationale: Setting PasswordAuthentication no in /etc/ssh/sshd_config forces authentication attempts to use public key cryptography or certificates. 34. Which modern subsystem replaced legacy iptables and ip6tables as the default

packet filtering framework in netfilter? A) ebtables B) nftables C) iproute D) tcpwrappers Correct Answer: B) nftables Rationale: nftables replaces iptables, offering a unified kernel packet processing engine, improved lookup performance, and cleaner syntax rules.

35. Which file controls legacy TCP Wrappers access permissions to block incoming connections by service name? A) /etc/hosts.equiv B) /etc/hosts.deny C) /etc/networks D) /etc/iptables.deny Correct Answer: B) /etc/hosts.deny Rationale: /etc/hosts.deny contains rules processed by TCP Wrappers (libwrap) to reject connections from listed hosts or IP addresses. 36. What is the primary operational function of Fail2ban on a hardened Linux system? A) Encrypting local user file systems automatically B) Monitoring log files for brute-force login attempts and dynamically updating firewall rules to block abusive IP addresses C) Scanning for outdated RPM/Deb packages D) Managing SSL/TLS web server certificates Correct Answer: B) Monitoring log files for brute-force login attempts and dynamically updating firewall rules to block abusive IP addresses Rationale: Fail2ban monitors authentication logs (like auth.log) for malicious patterns and inserts dynamic firewall drop rules against offending IP addresses. 37. Which SSH configuration option limits user login attempts to a specific non-standard TCP listening port? A) Port 2222 B) ListenPort 2222 C) SSHPort 2222

Section 5: System Auditing, Logging & Intrusion Detection

41. Which system utility is responsible for collecting, filtering, and writing system event logs generated by kernel and system services? A) cron B) logrotate C) rsyslog / journald D) auditd Correct Answer: C) rsyslog / journald Rationale: systemd-journald and rsyslog serve as primary log management engines, ingesting kernel messages, system facility logs, and application outputs. 42. Which command queries and displays structured binary logs managed by systemd- journald? A) journalctl B) dmesg C) cat /var/log/journal.log D) sysstat Correct Answer: A) journalctl Rationale: journalctl parses and formats binary system logs stored by systemd's journal service, supporting filtering by unit, boot, timestamp, or priority. 43. What configuration file defines audit rules for the Linux Audit Subsystem (auditd)? A) /etc/audit/auditd.conf B) /etc/audit/rules.d/audit.rules C) /etc/syslog.conf D) /etc/security/audit.conf Correct Answer: B) /etc/audit/rules.d/audit.rules Rationale: Rules defining monitored file paths, system call hooks, and execution tracking filters are defined within files under /etc/audit/rules.d/. 44. Which audit tool searches audit.log files to extract formatted event records based on specific queries? A) aureport

B) ausearch C) auditctl D) logwatch Correct Answer: B) ausearch Rationale: ausearch queries audit logs using filters such as event keys, process IDs, user IDs, syscalls, or timestamps.

45. What open-source Host-based Intrusion Detection System (HIDS) checks system file integrity hashes against stored baselines to detect unauthorized modifications? A) Snort B) AIDE (Advanced Intrusion Detection Environment) C) Wireshark D) Nmap Correct Answer: B) AIDE (Advanced Intrusion Detection Environment) Rationale: AIDE builds a local database of file attributes and cryptographic hashes (SHA- 256, etc.) to report modifications to system files. 46. Which utility utility manages log file growth by periodically rotating, compressing, and mailing log files? A) logrotate B) rsyslogd C) cron D) gzip Correct Answer: A) logrotate Rationale: logrotate runs automated maintenance schedules to compress, archive, and discard older system log files, preventing disk space exhaustion. 47. Which log file on Debian/Ubuntu systems records authentication failures, successful logins, and sudo executions? A) /var/log/auth.log B) /var/log/secure C) /var/log/messages D) /var/log/syslog Correct Answer: A) /var/log/auth.log Rationale: Debian-based operating systems write user authentication activities, SSH

encryption managed by the kernel dm-crypt module? A) BitLocker B) VeraCrypt C) LUKS (Linux Unified Key Setup) D) eCryptfs Correct Answer: C) LUKS (Linux Unified Key Setup) Rationale: LUKS is the standard Linux specification for block-device encryption, facilitating transportability and multi-key passphrase management using dm-crypt.

52. Which command formats a disk partition /dev/sdb1 using LUKS encryption format? A) cryptsetup luksFormat /dev/sdb B) mkfs.ext4 -encrypt /dev/sdb C) lukstool create /dev/sdb D) dm-crypt format /dev/sdb Correct Answer: A) cryptsetup luksFormat /dev/sdb Rationale: The cryptsetup luksFormat utility initializes LUKS headers and sets initial passphrase keys on designated block storage devices. 53. What security mechanism mitigates memory corruption and buffer overflow vulnerabilities by randomizing the memory locations of program execution components? A) DEP (Data Execution Prevention) B) ASLR (Address Space Layout Randomization) C) ECC Memory D) Secure Boot Correct Answer: B) ASLR (Address Space Layout Randomization) Rationale: ASLR randomizes positions of key data areas (stack, heap, libraries) in memory space, making execution of shellcode exploits difficult. 54. Which sysctl parameter controls the operational mode of Address Space Layout Randomization (ASLR)? A) kernel.randomize_va_space B) sys.memory.aslr_enable C) vm.aslr_level D) kernel.exec_shield Correct Answer: A) kernel.randomize_va_space

Rationale: Setting kernel.randomize_va_space=2 via sysctl enables full memory randomization for stack, VDSO, heap, and shared memory segments.

55. Which command loads updated sysctl security rules from /etc/sysctl.conf into the active running kernel memory? A) sysctl -p B) sysctl --reload-all C) systemctl restart sysctl D) kernel-config --update Correct Answer: A) sysctl -p Rationale: Executing sysctl -p parses runtime configuration files (default /etc/sysctl.conf) and applies parameters into live kernel space. 56. What security setting prevents unprivileged users from viewing kernel memory addresses via dmesg output? A) kernel.sysrq= B) kernel.dmesg_restrict= C) fs.protected_symlinks= D) security.dmesg_hide= Correct Answer: B) kernel.dmesg_restrict= Rationale: Enabling kernel.dmesg_restrict restricts access to kernel syslog buffers strictly to users granted CAP_SYSLOG privileges. 57. Which UEFI technology verifies the cryptographic signature of the Linux kernel and bootloader during boot to block unauthorized rootkits? A) Secure Boot B) TPM 2.0 Lock C) GRUB Encryption D) Trusted Execution Environment Correct Answer: A) Secure Boot Rationale: UEFI Secure Boot verifies digital signatures of bootloaders (shim/GRUB) and Linux kernels against trusted hardware keys to prevent tampered code boot. 58. How can an administrator secure the GRUB bootloader against unauthorized boot parameter modification?

C) rpm -Uvh --security D) dnf patch-apply Correct Answer: A) yum update --security Rationale: yum/dnf update --security targets advisory patches classified under security notices, skipping feature upgrades.

62. Which Debian tool installs security software updates automatically without administrative manual intervention? A) cron-apt B) apt-secure C) unattended-upgrades D) dpkg-auto-update Correct Answer: C) unattended-upgrades Rationale: The unattended-upgrades package automatically downloads and installs security updates for Debian/Ubuntu environments. 63. Which command identifies and removes unneeded orphaned package dependencies that expand a server's attack surface? A) apt-get autoremove / dnf autoremove B) package-clean --all C) rpm -e --orphans D) dpkg --purge-all Correct Answer: A) apt-get autoremove / dnf autoremove Rationale: The autoremove command purges orphan packages and dependencies no longer needed by any installed applications, shrinking potential exploitation surfaces. 64. Which system file sets environment variable limits for shell users, including automatic idle session timeouts via TMOUT? A) /etc/environment B) /etc/security/limits.conf C) /etc/bash.bashrc D) /etc/profile Correct Answer: D) /etc/profile Rationale: Exporting TMOUT=900 in /etc/profile forces bash interactive sub-shells to terminate automatically after 15 minutes of user inactivity.

65. What configuration file manages user resource limits, such as limiting max login sessions or restricting core file dumps? A) /etc/security/limits.conf B) /etc/sysctl.conf C) /etc/login.defs D) /etc/systemd/user.conf Correct Answer: A) /etc/security/limits.conf Rationale: pam_limits reads /etc/security/limits.conf to set hard and soft system boundaries for memory, CPU utilization, max process counts, and core dumps. 66. Why should core dump generation be restricted or disabled on production Linux systems? A) Core dumps automatically restart server hardware without warning B) Core dump files can contain sensitive raw memory contents including passwords and cryptographic keys C) Core dumps overwrite active network firewall configurations D) Core dumps prevent users from issuing sudo commands Correct Answer: B) Core dump files can contain sensitive raw memory contents including passwords and cryptographic keys Rationale: Memory core dumps generated when processes crash can expose unencrypted secrets, passwords, or session tokens stored in RAM to unauthorized local users. 67. What systemd feature isolates a system service within its own restrictive mount and process namespace (e.g., ProtectSystem=full)? A) systemd service sandboxing B) Chroot execution wrapper C) Docker containerization D) PAM namespace isolation Correct Answer: A) systemd service sandboxing Rationale: Modern systemd service unit files utilize security flags (ProtectSystem, ProtectHome, PrivateTmp) to isolate services inside restricted execution namespaces. 68. Which command is used to securely wipe files by overwriting data blocks on spinning storage media prior to deletion?