Unit 2: Permissions, Processes, Services, SSH, and Logs - Practice Quiz

CSE493 — Linux System Administration 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 Which three basic permissions can be assigned to a Linux file?

Linux File System Permissions Easy
A. Copy, move, and rename
B. Open, close, and delete
C. Create, search, and print
D. Read, write, and execute

2 Which command changes the permissions of a file?

Managing File System Permissions from the Command Line Easy
A. chown
B. chdir
C. chgrp
D. chmod

3 Which command displays or sets the permission mask used when creating new files and directories?

Managing Default Permissions and File Access Easy
A. passwd
B. useradd
C. umask
D. setfacl

4 What is a process in Linux?

Processes Easy
A. A stored configuration file
B. A program currently running
C. A registered user account
D. A mounted file system

5 Which command lists jobs started from the current shell?

Controlling Jobs Easy
A. tasks
B. work
C. queue
D. jobs

6 Which signal does the kill command send by default?

Killing Processes Easy
A. SIGHUP
B. SIGTERM
C. SIGKILL
D. SIGSTOP

7 Which command provides a continuously updated view of running processes?

Monitoring Process Activity Easy
A. uname
B. uptime
C. free
D. top

8 What is a daemon in Linux?

Controlling Services and Daemons Easy
A. A compressed archive file
B. A background service process
C. A file permission category
D. A command-line text editor

9 Which command checks whether a systemd service is enabled to start automatically?

Identifying Automatically Started System Processes Easy
A. systemctl is-active
B. systemctl is-failed
C. systemctl is-system-running
D. systemctl is-enabled

10 Which command starts a service named httpd immediately?

Controlling System Services Easy
A. systemctl start httpd
B. systemctl status httpd
C. systemctl enable httpd
D. systemctl reload httpd

11 Which file is the main server configuration file for the OpenSSH daemon?

Configuring and Securing OpenSSH Service Easy
A. /etc/ssh/ssh_config
B. /etc/systemd/sshd.conf
C. /etc/hosts.allow
D. /etc/ssh/sshd_config

12 Which command connects to the host server1 using the account student?

Accessing the Remote Command Line with SSH Easy
A. ssh student@server1
B. sftp server1@student
C. sshd student@server1
D. scp student@server1

13 On the remote system, which file normally stores public keys authorized for SSH login?

Configuring SSH Key-based Authentication Easy
A. ~/.ssh/authorized_keys
B. ~/.ssh/known_hosts
C. ~/.ssh/id_rsa
D. ~/.ssh/config

14 Which directive in sshd_config changes the port on which the SSH server listens?

Customizing SSH Service Configuration Easy
A. Listen
B. Protocol
C. Socket
D. Port

15 What is the main purpose of log rotation?

Analyzing and Storing Logs Easy
A. To start network services
B. To limit log file growth
C. To change file ownership
D. To create user passwords

16 Which systemd component collects and stores journal messages?

System Log Architecture Easy
A. systemd-journald
B. systemd-timedated
C. systemd-hostnamed
D. systemd-logind

17 Which command displays the last lines of a text-based log file?

Reviewing Syslog Files Easy
A. sort
B. tail
C. head
D. touch

18 Which command displays entries stored in the systemd journal?

Reviewing systemd Journal Entries Easy
A. systemctl
B. logrotate
C. dmesgctl
D. journalctl

19 Which directory is commonly created to enable persistent systemd journal storage?

Preserving the systemd Journal Easy
A. /run/log/archive
B. /usr/share/journal
C. /var/log/journal
D. /etc/log/journal

20 Which command displays the current system time and time synchronization status on a systemd-based system?

Maintaining Accurate Time Easy
A. timedatectl
B. timeconfig
C. clockstat
D. datecheck

21 A directory has permissions drwxr-x--- and is owned by alice:developers. What can user bob, who belongs to the developers group, do in this directory?

Controlling Access to Files with Linux File System Permissions Medium
A. List and access existing entries, but not create or delete them
B. List, create, delete, and rename entries
C. Create and delete entries, but not list them
D. Read file contents without accessing entry metadata

22 A regular file has mode 640 and is owned by root:finance. Which permission set does this represent?

Linux File System Permissions Medium
A. Owner: read/write; group: write; others: none
B. Owner: read/write/execute; group: read; others: none
C. Owner: read/execute; group: read; others: none
D. Owner: read/write; group: read; others: none

23 You need to give the group execute permission on deploy.sh while leaving every other permission unchanged. Which command should you use?

Managing File System Permissions from the Command Line Medium
A. chmod g=x deploy.sh
B. chmod 750 deploy.sh
C. chmod g+x deploy.sh
D. chmod a+x deploy.sh

24 A process creates regular files with a base mode of 666. If its umask is 027, what permissions will a newly created file normally receive?

Managing Default Permissions and File Access Medium
A. 650
B. 750
C. 660
D. 640

25 Members of the project group share /srv/project. New files must inherit the directory's group ownership. Which change provides this behavior?

Managing Default Permissions and File Access Medium
A. chmod g+x /srv/project and recursively replace ownership on every login
B. chmod g+s /srv/project
C. chmod u+s /srv/project
D. chmod +t /srv/project

26 A shell launches a command and receives PID 8420. Which statement correctly describes the PPID shown for that command?

Processes Medium
A. It identifies the user who owns the command
B. It identifies the command's current process group
C. It identifies the most recent child started by the command
D. It identifies the process that started the command

27 You suspend a foreground command by pressing Ctrl+Z. Which command resumes job number 2 in the background?

Controlling Jobs Medium
A. jobs %2
B. nohup %2
C. fg %2
D. bg %2

28 A process is unresponsive, but you want to allow it to perform normal cleanup before stopping. Which command should you try first for PID 4187?

Killing Processes Medium
A. kill -STOP 4187
B. kill -TERM 4187
C. kill -KILL 4187
D. kill -HUP 4187

29 A server feels slow, and you need an updating view that can sort processes by CPU usage. Which command is most appropriate?

Monitoring Process Activity Medium
A. systemctl list-units, which continuously samples every process and sorts them by CPU consumption
B. top
C. jobs -l
D. ps -ef

30 A process has a nice value of 10, while another has a nice value of 0. Under similar CPU demand, what does this imply?

Monitoring and Managing Linux Processes Medium
A. The process at 10 has lower scheduling priority
B. The process at 10 can run only when the other exits
C. Both processes always receive identical CPU time
D. The process at 10 has higher scheduling priority

31 On a systemd-based server, which command shows enabled service unit files that are configured to start automatically?

Identifying Automatically Started System Processes Medium
A. systemctl list-unit-files --type=service --state=enabled
B. systemctl list-units --type=service --state=failed
C. systemctl status --type=service --state=enabled
D. journalctl --list-boots --unit=service --state=enabled

32 You need httpd to start now and also start automatically after future boots. Which command performs both actions?

Controlling System Services Medium
A. systemctl enable httpd
B. systemctl start --enable httpd
C. systemctl restart httpd
D. systemctl enable --now httpd

33 After editing a systemd unit file on disk, which command makes systemd reload unit definitions before you restart the service?

Controlling Services and Daemons Medium
A. systemctl reload systemd
B. systemctl reset-failed
C. systemctl daemon-reload
D. systemctl reexec SERVICE, which reloads only the edited unit while preserving all dependency state

34 The SSH daemon on server.example.com listens on port 2222. Which command connects as user admin?

Accessing the Remote Command Line with SSH Medium
A. ssh -p 2222 admin@server.example.com
B. ssh -P 2222 admin@server.example.com
C. ssh admin@server.example.com:2222
D. ssh --service 2222 admin@server.example.com

35 You generated a key pair on a client and need to install the public key for account admin on host1. Which command is designed for this task?

Configuring SSH Key-based Authentication Medium
A. ssh-keygen admin@host1
B. ssh-copy-id admin@host1
C. ssh-agent admin@host1
D. scp ~/.ssh/id_ed25519 admin@host1:~/.ssh/authorized_keys

36 An SSH server should reject direct root logins while still allowing other authorized users. Which sshd_config directive implements this requirement?

Configuring and Securing OpenSSH Service Medium
A. DenyUsers root administrators operators, which disables root and all accounts in two administrative groups
B. AllowRootLogin no
C. RootAuthentication no
D. PermitRootLogin no

37 Before restarting sshd after modifying /etc/ssh/sshd_config, which command checks the configuration for syntax errors?

Customizing SSH Service Configuration Medium
A. sshd -t
B. systemctl validate sshd
C. ssh -t
D. sshd -v

38 On a distribution that stores general system messages in /var/log/messages, which command follows newly appended log entries in real time?

Reviewing Syslog Files Medium
A. head -f /var/log/messages
B. grep --recursive --follow /var/log/messages
C. less -N /var/log/messages
D. tail -f /var/log/messages

39 A service named backup.service failed during the current boot. Which command displays journal entries only for that unit and boot?

Reviewing systemd Journal Entries Medium
A. journalctl -b backup.service --service
B. journalctl -p backup.service -b
C. systemctl logs backup.service --current-boot
D. journalctl -u backup.service -b

40 A system currently keeps journal data only in volatile storage. Which change commonly enables persistent journal storage across reboots?

Preserving the systemd Journal Medium
A. Create /var/log/journal and restart systemd-journald
B. Create /run/log/journal and restart systemd-journald
C. Copy /run/log/journal into /tmp/journal during shutdown and restore it manually during startup
D. Create /etc/log/journal and restart the rsyslog service

41 A shared directory has mode 2770, is owned by root:developers, and contains files created by multiple members of developers. Members must continue inheriting the directory's group, but they must not be able to delete or rename files owned by other members. Which command best implements this requirement?

Controlling Access to Files with Linux File System Permissions Hard
A. chmod 3770 /srv/shared
B. chmod 2770 /srv/shared
C. chmod 4770 /srv/shared
D. chmod 1770 /srv/shared

42 A root-owned executable initially has mode 4711. Assuming the command is run by root, what mode results from chmod u-s,g+s,o-rwx program?

Linux File System Permissions Hard
A. 2710
B. 6710
C. 2700
D. 4700

43 A tree contains directories with mode 755, executable scripts with mode 755, and data files with mode 644. An administrator runs:

chmod -R a-x TREE && chmod -R u=rwX,g=rX,o= TREE

What is the resulting access mode pattern?

Managing File System Permissions from the Command Line Hard
A. Directories become 750; all regular files become 640
B. Directories become 740; executable scripts remain 750
C. Directories become 640; all regular files become 640
D. Directories become 750; executable scripts become 750

44 A process has umask 0027. It requests mode 0660 when creating a regular file and mode 0770 when creating a directory. Assuming no default ACLs are present, which modes are created?

Managing Default Permissions and File Access Hard
A. File 0620; directory 0750
B. File 0640; directory 0740
C. File 0640; directory 0750
D. File 0660; directory 0770

45 A service has accumulated many zombie child processes. Sending SIGKILL to the zombie PIDs has no effect. Which action most directly resolves the existing zombies?

Monitoring and Managing Linux Processes Hard
A. Move the zombie PIDs into a separate control group
B. Renice the zombie processes to the lowest priority
C. Restart the parent service so its children are reaped
D. Run wait for the PIDs from an administrative shell

46 An unprivileged user owns a process whose nice value is 5. The user runs renice -n 10 -p PID. What is the expected result on a standard Linux system?

Processes Hard
A. The nice value becomes 15, lowering CPU scheduling priority
B. The nice value becomes 10, lowering CPU scheduling priority
C. The nice value becomes 10, increasing CPU scheduling priority
D. The command fails because only root may change nice values

47 A foreground job already has all input and output redirected to files. The operator presses Ctrl-Z and wants it to continue in the background, remain listed in the current shell's job table, and avoid receiving SIGHUP when the shell exits. Which sequence is appropriate?

Controlling Jobs Hard
A. fg %1; nohup %1 &
B. bg %1; disown %1
C. jobs %1; setsid %1
D. bg %1; disown -h %1

48 A pipeline consists of several processes in process group 8120. The administrator wants to send SIGTERM to every process in that group without relying on individual PIDs. Which command is correct?

Killing Processes Hard
A. killall -TERM -- -8120
B. kill -TERM -- 8120
C. kill -GROUP -- 8120
D. kill -TERM -- -8120

49 A server reports a load average of 40, yet CPU utilization remains near 10%. ps shows many processes in state D. Which interpretation is most accurate?

Monitoring Process Activity Hard
A. Tasks are zombies whose exit statuses increase the load average
B. Tasks are sleeping interruptibly but counted as runnable processes
C. Tasks are blocked in uninterruptible sleep, commonly awaiting I/O
D. Tasks are stopped by job control and consuming reserved CPU time

50 A systemd unit applies firewall rules through a command that exits successfully. The unit must remain logically active afterward so that systemctl stop can invoke ExecStop to remove the rules. Which unit settings are appropriate?

Controlling Services and Daemons Hard
A. Type=forking and GuessMainPID=no
B. Type=notify and NotifyAccess=all
C. Type=simple and RemainAfterExit=no
D. Type=oneshot and RemainAfterExit=yes

51 systemctl is-enabled helper.service reports static, but helper.service starts during every boot. What is the most likely explanation?

Identifying Automatically Started System Processes Hard
A. The service is enabled through a hidden SysV runlevel
B. Another enabled unit starts it through a dependency
C. The service starts because static is equivalent to enabled
D. Static units are automatically started by every target

52 A service must be stopped immediately and prevented from being started manually or as a dependency after future reboots. Which command provides the strongest systemd-level prohibition?

Controlling System Services Hard
A. systemctl stop cups.service
B. systemctl disable --now cups.service
C. systemctl preset-disable cups.service
D. systemctl mask --now cups.service

53 An SSH server must allow root to authenticate using public keys but must reject password and keyboard-interactive authentication for root. Which sshd_config directive best expresses this policy?

Configuring and Securing OpenSSH Service Hard
A. PasswordAuthentication no
B. PermitRootLogin without-passwords
C. PermitRootLogin prohibit-password
D. PermitRootLogin forced-commands-only

54 After a server is rebuilt, SSH reports that its host key has changed. What is the safest administrative response?

Accessing the Remote Command Line with SSH Hard
A. Disable strict host-key checking for the destination permanently
B. Run ssh-keyscan remotely and immediately trust its returned key
C. Verify the new fingerprint out of band, then replace the saved key
D. Delete the entire known_hosts file and reconnect to every host

55 A public key in authorized_keys must run only /usr/local/bin/report and must not permit a PTY, agent forwarding, X11 forwarding, or TCP forwarding. Which entry prefix is most suitable on a modern OpenSSH server?

Configuring SSH Key-based Authentication Hard
A. restrict,command="/usr/local/bin/report"
B. no-agent-forwarding,command="/usr/local/bin/report"
C. cert-authority,command="/usr/local/bin/report"
D. environment="COMMAND=/usr/local/bin/report"

56 An administrator has added several Match blocks to sshd_config. Before reloading SSH, which commands should be used to check syntax and inspect the effective configuration for user backup connecting from 192.0.2.25?

Customizing SSH Service Configuration Hard
A. sshd -t and sshd -T -C user=backup,host=server,addr=192.0.2.25
B. ssh-keygen -t and ssh-keyscan -C backup@192.0.2.25
C. sshd -v and sshd -Q user=backup,host=server,addr=192.0.2.25
D. ssh -t and ssh -G -C user=backup,host=server,addr=192.0.2.25

57 A program launched by a systemd service writes only to standard output and standard error. The system uses systemd-journald and an rsyslog configuration that loads imjournal. Which path best describes how the message can reach a traditional log file?

System Log Architecture Hard
A. systemd captures the streams, journald stores them, and rsyslog reads the journal
B. rsyslog captures the streams directly and forwards them to journald for indexing
C. The application must call the syslog API because standard streams cannot be logged
D. The kernel converts both streams into audit events that rsyslog writes to disk

58 An rsyslog rule uses the selector authpriv.warning. Which message matches this selector under standard syslog severity semantics?

Reviewing Syslog Files Hard
A. A daemon.emerg message
B. An auth.info message
C. An authpriv.err message
D. An authpriv.notice message

59 A host currently keeps journal data only under /run/log/journal. Which change most reliably enables storage across reboots and prepares the journal directory with appropriate system-managed attributes?

Preserving the systemd Journal Hard
A. Run journalctl --vacuum-time=1year and copy /run/log/journal during shutdown
B. Set Storage=volatile, create /var/log/syslog, and send SIGHUP to journald
C. Enable ForwardToConsole=yes, bind-mount /run, and reload all journal readers
D. Set Storage=persistent, prepare /var/log/journal with systemd-tmpfiles, and restart journald

60 After a virtual machine resumes, its clock is eight minutes behind and time-sensitive authentication is failing. chronyd is running, but normal correction would slew the clock too slowly. Which command requests an immediate correction while retaining chrony synchronization?

Maintaining Accurate Time Hard
A. chronyc burst 4/4
B. chronyc makestep
C. hwclock --systohc
D. timedatectl set-ntp false