Unit 2: Permissions, Processes, Services, SSH, and Logs - Practice Quiz
1 Which three basic permissions can be assigned to a Linux file?
2 Which command changes the permissions of a file?
chown
chdir
chgrp
chmod
3 Which command displays or sets the permission mask used when creating new files and directories?
passwd
useradd
umask
setfacl
4 What is a process in Linux?
5 Which command lists jobs started from the current shell?
tasks
work
queue
jobs
6
Which signal does the kill command send by default?
SIGHUP
SIGTERM
SIGKILL
SIGSTOP
7 Which command provides a continuously updated view of running processes?
uname
uptime
free
top
8 What is a daemon in Linux?
9 Which command checks whether a systemd service is enabled to start automatically?
systemctl is-active
systemctl is-failed
systemctl is-system-running
systemctl is-enabled
10
Which command starts a service named httpd immediately?
systemctl start httpd
systemctl status httpd
systemctl enable httpd
systemctl reload httpd
11 Which file is the main server configuration file for the OpenSSH daemon?
/etc/ssh/ssh_config
/etc/systemd/sshd.conf
/etc/hosts.allow
/etc/ssh/sshd_config
12
Which command connects to the host server1 using the account student?
ssh student@server1
sftp server1@student
sshd student@server1
scp student@server1
13 On the remote system, which file normally stores public keys authorized for SSH login?
~/.ssh/authorized_keys
~/.ssh/known_hosts
~/.ssh/id_rsa
~/.ssh/config
14
Which directive in sshd_config changes the port on which the SSH server listens?
Listen
Protocol
Socket
Port
15 What is the main purpose of log rotation?
16 Which systemd component collects and stores journal messages?
systemd-journald
systemd-timedated
systemd-hostnamed
systemd-logind
17 Which command displays the last lines of a text-based log file?
sort
tail
head
touch
18 Which command displays entries stored in the systemd journal?
systemctl
logrotate
dmesgctl
journalctl
19 Which directory is commonly created to enable persistent systemd journal storage?
/run/log/archive
/usr/share/journal
/var/log/journal
/etc/log/journal
20 Which command displays the current system time and time synchronization status on a systemd-based system?
timedatectl
timeconfig
clockstat
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?
22
A regular file has mode 640 and is owned by root:finance. Which permission set does this represent?
23
You need to give the group execute permission on deploy.sh while leaving every other permission unchanged. Which command should you use?
chmod g=x deploy.sh
chmod 750 deploy.sh
chmod g+x deploy.sh
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?
650
750
660
640
25
Members of the project group share /srv/project. New files must inherit the directory's group ownership. Which change provides this behavior?
chmod g+x /srv/project and recursively replace ownership on every login
chmod g+s /srv/project
chmod u+s /srv/project
chmod +t /srv/project
26
A shell launches a command and receives PID 8420. Which statement correctly describes the PPID shown for that command?
27
You suspend a foreground command by pressing Ctrl+Z. Which command resumes job number 2 in the background?
jobs %2
nohup %2
fg %2
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?
kill -STOP 4187
kill -TERM 4187
kill -KILL 4187
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?
systemctl list-units, which continuously samples every process and sorts them by CPU consumption
top
jobs -l
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?
10 has lower scheduling priority
10 can run only when the other exits
10 has higher scheduling priority
31 On a systemd-based server, which command shows enabled service unit files that are configured to start automatically?
systemctl list-unit-files --type=service --state=enabled
systemctl list-units --type=service --state=failed
systemctl status --type=service --state=enabled
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?
systemctl enable httpd
systemctl start --enable httpd
systemctl restart httpd
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?
systemctl reload systemd
systemctl reset-failed
systemctl daemon-reload
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?
ssh -p 2222 admin@server.example.com
ssh -P 2222 admin@server.example.com
ssh admin@server.example.com:2222
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?
ssh-keygen admin@host1
ssh-copy-id admin@host1
ssh-agent admin@host1
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?
DenyUsers root administrators operators, which disables root and all accounts in two administrative groups
AllowRootLogin no
RootAuthentication no
PermitRootLogin no
37
Before restarting sshd after modifying /etc/ssh/sshd_config, which command checks the configuration for syntax errors?
sshd -t
systemctl validate sshd
ssh -t
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?
head -f /var/log/messages
grep --recursive --follow /var/log/messages
less -N /var/log/messages
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?
journalctl -b backup.service --service
journalctl -p backup.service -b
systemctl logs backup.service --current-boot
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?
/var/log/journal and restart systemd-journald
/run/log/journal and restart systemd-journald
/run/log/journal into /tmp/journal during shutdown and restore it manually during startup
/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?
chmod 3770 /srv/shared
chmod 2770 /srv/shared
chmod 4770 /srv/shared
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?
2710
6710
2700
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?
750; all regular files become 640
740; executable scripts remain 750
640; all regular files become 640
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?
0620; directory 0750
0640; directory 0740
0640; directory 0750
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?
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?
15, lowering CPU scheduling priority
10, lowering CPU scheduling priority
10, increasing CPU scheduling priority
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?
fg %1; nohup %1 &
bg %1; disown %1
jobs %1; setsid %1
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?
killall -TERM -- -8120
kill -TERM -- 8120
kill -GROUP -- 8120
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?
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?
Type=forking and GuessMainPID=no
Type=notify and NotifyAccess=all
Type=simple and RemainAfterExit=no
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?
static is equivalent to enabled
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?
systemctl stop cups.service
systemctl disable --now cups.service
systemctl preset-disable cups.service
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?
PasswordAuthentication no
PermitRootLogin without-passwords
PermitRootLogin prohibit-password
PermitRootLogin forced-commands-only
54 After a server is rebuilt, SSH reports that its host key has changed. What is the safest administrative response?
ssh-keyscan remotely and immediately trust its returned key
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?
restrict,command="/usr/local/bin/report"
no-agent-forwarding,command="/usr/local/bin/report"
cert-authority,command="/usr/local/bin/report"
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?
sshd -t and sshd -T -C user=backup,host=server,addr=192.0.2.25
ssh-keygen -t and ssh-keyscan -C backup@192.0.2.25
sshd -v and sshd -Q user=backup,host=server,addr=192.0.2.25
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?
58
An rsyslog rule uses the selector authpriv.warning. Which message matches this selector under standard syslog severity semantics?
daemon.emerg message
auth.info message
authpriv.err message
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?
journalctl --vacuum-time=1year and copy /run/log/journal during shutdown
Storage=volatile, create /var/log/syslog, and send SIGHUP to journald
ForwardToConsole=yes, bind-mount /run, and reload all journal readers
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?
chronyc burst 4/4
chronyc makestep
hwclock --systohc
timedatectl set-ntp false
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →