| Modern Samurai
This is a full-length practice exam with 60 questions. All 60 questions are unique, with shuffled order and options. Only one correct answer per question.
Instructions
- Choose the best answer.
- All questions are single choice.
- Time: 90 minutes.
- Passing score reference: ~500/800.
- Answer key (with explanations) is at the end.
Quiz
Question 1
SSH key generation command:
A) gpg
B) openssl
C) ssh-keygen
D) ssh-add
Question 2
To change the locale environment:
A) LANG or LC_ALL variables
B) PS1
C) PATH
D) TZ variable
Question 3
Command to view current locale settings:
A) env
B) who
C) date
D) locale
Question 4
Public cloud Linux security often involves:
A) Only local sudo
B) No differences from on-prem
C) Provider-managed firewalls and multi-factor auth
D) Volatile storage always persistent
Question 5
Log rotation is handled by:
A) cron
B) logrotate
C) rsyslog
D) journald
Question 6
The command to view or set IP address configuration is:
A) ifconfig or ip addr
B) ping
C) route
D) netstat
Question 7
User login history command:
A) last
B) who
C) All, but last for history
D) w
Question 8
Open source participation often involves:
A) Purchasing licenses
B) No community
C) Closed development
D) Mailing lists, bug reports, and code contributions
Question 9
Private IP address ranges exclude:
A) 192.168.0.0/16
B) 8.8.8.8
C) 10.0.0.0/8
D) 172.16.0.0/12
Question 10
Public domain in open source means:
A) Commercial only
B) GPL compatible only
C) All rights reserved
D) No copyright restrictions
Question 11
Which protocol uses port 22 by default?
A) DNS
B) SMTP
C) HTTP
D) SSH
Question 12
Which file is typically sourced for interactive non-login Bash shells?
A) /etc/profile
B) ~/.bash_profile
C) ~/.bash_logout
D) ~/.bashrc
Question 13
What tool traces the route to a destination?
A) traceroute
B) dig
C) ping
D) host
Question 14
Command to check open ports:
A) nmap (from remote)
B) lsof
C) Both, but primarily ss/netstat locally
D) ss or netstat
Question 15
To add a user to a supplementary group:
A) passwd
B) groupadd
C) userdel
D) usermod -aG group user
Question 16
Common MTAs include:
A) Apache and Nginx
B) Postfix and Exim
C) BIND and DHCP
D) SSH and FTP
Question 17
The sudo configuration file is:
A) /etc/sudoers
B) /etc/passwd
C) /etc/shadow
D) /etc/sudo.conf
Question 18
Which command debugs a script by showing expanded commands?
A) bash -x script.sh
B) bash -n script.sh
C) bash -v script.sh
D) set -e
Question 19
To find SUID files:
A) chmod u+s
B) passwd
C) find / -perm -4000
D) ls -l
Question 20
Disabling unnecessary services:
A) chkconfig
B) systemctl disable
C) Both approaches
D) Only xinetd
Question 21
The command ss is primarily used to:
A) Resolve hostnames
B) Display socket statistics
C) Test connectivity
D) Configure DNS
Question 22
Basic host security includes:
A) Open all ports
B) No logging
C) Only passwords
D) Turning off unused services and using sudo
Question 23
To create a new user account:
A) passwd
B) useradd
C) usermod
D) groupadd
Question 24
To set the command search path, you modify:
A) PS1
B) PATH variable
C) HOME
D) LD_LIBRARY_PATH
Question 25
Which construct is used for conditional branching in Bash?
A) case only
B) if statement
C) for loop
D) while loop
Question 26
The main configuration for rsyslog is:
A) /etc/aliases
B) /var/log
C) /etc/rsyslog.conf
D) /etc/logrotate.conf
Question 27
Which file stores user passwords (hashed)?
A) /etc/group
B) /etc/login.defs
C) /etc/shadow
D) /etc/passwd
Question 28
How do you shift positional parameters in a script?
A) move
B) pop
C) shift
D) next
Question 29
How do you make a Bash script executable?
A) source script.sh
B) bash script.sh
C) chown +x script.sh
D) chmod +x script.sh
Question 30
The at command is used for:
A) One-time scheduled jobs
B) Log rotation
C) User management
D) Recurring jobs
Question 31
To view systemd journal logs:
A) dmesg
B) journalctl
C) logger
D) tail /var/log
Question 32
The GPL license requires:
A) Payment for use
B) Source code availability for modifications
C) Proprietary use only
D) No redistribution
Question 33
To synchronize time with NTP:
A) rsyslog
B) logrotate
C) postfix
D) chronyd or ntpd
Question 34
To limit user processes:
A) chage
B) sudo
C) ulimit
D) last
Question 35
For basic firewall management (one common tool):
A) nmap
B) wireshark
C) tcpdump
D) firewalld or iptables
Question 36
What is the shebang line for a Bash script?
A) #!/bin/sh
B) #!bash
C) #!/bin/bash
D) #/bin/bash
Question 37
To query NTP status:
A) ntpq
B) dig
C) ping
D) ss
Question 38
In a Bash script, what does $# represent?
A) The process ID
B) The last argument
C) The script name
D) The number of arguments passed
Question 39
To audit open files/ports:
A) lsof or fuser
B) find
C) grep
D) ps
Question 40
What does the source command (or .) do?
A) Creates an alias
B) Executes a script in a new shell
C) Sets environment variables permanently
D) Reads and executes commands from a file in the current shell
Question 41
IPv6 link-local addresses start with:
A) 192.168.
B) 2001:
C) fe80::
D) ff00::
Question 42
To forward SSH ports:
A) ssh-agent
B) gpg
C) ssh-keygen
D) ssh -L or -R
Question 43
To schedule a recurring job with cron:
A) Edit /etc/crontab or user crontab
B) anacron only
C) systemctl cron
D) Use at command
Question 44
Shadow passwords improve security by:
A) Limiting ports
B) Using public keys only
C) Storing hashes separately from /etc/passwd
D) Encrypting all files
Question 45
To set a default route:
A) nmcli route
B) ip route add default via gateway
C) route add -net
D) ifconfig default
Question 46
What does CIDR notation /24 represent?
A) Subnet mask 255.0.0.0
B) Subnet mask 255.255.255.0
C) 16-bit network
D) Host-only address
Question 47
Which file configures DNS servers for the client?
A) /etc/nsswitch.conf
B) /etc/resolv.conf
C) /etc/hostname
D) /etc/hosts
Question 48
Hardware clock command:
A) date -s
B) chronyc
C) tzselect
D) hwclock
Question 49
/etc/anacrontab is used by:
A) systemd timers
B) anacron for periodic jobs
C) cron daily
D) at
Question 50
A permissive license example:
A) GPL only
B) Proprietary
C) AGPL
D) BSD or MIT
Question 51
To change a user’s password aging:
A) usermod
B) passwd
C) chage
D) id
Question 52
GnuPG is used for:
A) SSH only
B) Encryption and signing
C) User accounts
D) Firewall
Question 53
Timezone configuration files are in:
A) /etc/postfix/
B) /etc/cron.d/
C) /etc/rsyslog.d/
D) /usr/share/zoneinfo/
Question 54
To create email aliases:
A) /etc/aliases then newaliases
B) mailq
C) postfix main.cf
D) ~/.forward
Question 55
TCP differs from UDP in that it is:
A) Connectionless
B) Faster but unreliable
C) Used only for DNS
D) Connection-oriented with reliability
Question 56
Automatic logout variable:
A) LANG
B) PS1
C) TMOUT
D) PATH
Question 57
The skeleton directory for new users is:
A) /etc/skel
B) /home
C) /var
D) /etc/passwd
Question 58
What command searches for the location of a command in the PATH?
A) locate
B) find
C) whereis
D) which
Question 59
Open source characteristics include:
A) Closed source
B) Guaranteed support
C) No modifications allowed
D) Source code access and community development
Question 60
Command to set system date and time:
A) ntpdate
B) hwclock
C) timedatectl
D) date
Answer Key And Explanations
1. C
ssh-keygen generates SSH key pairs (public/private) for passwordless authentication. gpg is for GnuPG, openssl for certificates, ssh-add adds keys to the agent.
2. A
LANG and LC_ALL control locale settings (language, formatting). PS1 is the prompt, PATH is for executables, TZ is for time zone.
3. D
The locale command displays current locale settings. env shows all variables, who shows logged-in users, date shows time.
4. C
Public cloud providers (AWS, Azure, etc.) manage firewalls (security groups) and enforce MFA. Local sudo is still used but not the only measure.
5. B
logrotate handles compression, rotation, and deletion of log files based on size/time. cron schedules it, rsyslog/journald handle logging.
6. A
ip addr (modern) or legacy ifconfig views/sets IP configuration. ping tests connectivity, route manages routing table, netstat shows connections.
7. A
last shows login/logout history from /var/log/wtmp. who and w show current sessions.
8. D
Open source encourages collaboration via mailing lists, bug trackers (e.g., GitHub issues), and pull requests.
9. B
8.8.8.8 is a public Google DNS server. The others are standard private ranges (RFC 1918).
10. D
Public domain software has no copyright restrictions and can be used freely for any purpose.
11. D
SSH (Secure Shell) uses TCP port 22 by default. HTTP=80, DNS=53, SMTP=25.
12. D
~/.bashrc is sourced for interactive non-login Bash shells. ~/.bash_profile is for login shells.
13. A
traceroute (or tracepath) shows the path packets take. ping tests reachability, dig/host are for DNS.
14. D
ss (or legacy netstat) shows local socket statistics. nmap is for remote scanning; lsof shows files/processes.
15. D
usermod -aG group user appends a user to a supplementary group without removing existing ones.
16. B
Postfix and Exim are popular Mail Transfer Agents (MTAs). The others are web, DNS, or remote access tools.
17. A
/etc/sudoers (edited via visudo) defines sudo privileges. passwd/shadow store user info.
18. A
bash -x shows commands and expansions as they execute (debug mode). -n checks syntax, -v prints lines read.
19. C
find / -perm -4000 locates files with the SUID bit set (dangerous if misused).
20. C
Both chkconfig (SysV) and systemctl disable (systemd) are valid depending on the init system.
21. B
ss displays socket statistics (replacement for netstat). Other options are unrelated.
22. D
Core practices: disable unused services and use sudo for privilege escalation instead of root login.
23. B
useradd creates a new user account (with options for home, shell, etc.). passwd changes passwords.
24. B
The PATH environment variable defines directories searched for commands.
25. B
if statements handle conditional branching. Loops (for, while) and case are different constructs.
26. C
/etc/rsyslog.conf is the primary config file for rsyslog (with includes in /etc/rsyslog.d/).
27. C
/etc/shadow stores hashed passwords securely (readable only by root). /etc/passwd is world-readable.
28. C
The shift command moves positional parameters left (e.g., $2 becomes $1).
29. D
chmod +x script.sh makes the script executable. The shebang then determines the interpreter.
30. A
at schedules one-time jobs. cron is for recurring.
31. B
journalctl views systemd journal logs. dmesg is kernel ring buffer, tail for text logs.
32. B
GPL (GNU General Public License) is copyleft: modified versions must provide source code.
33. D
chronyd (common) or ntpd synchronize time with NTP servers.
34. C
ulimit sets resource limits (e.g., max processes) for a user/session.
35. D
firewalld (dynamic) or iptables (legacy) manage host firewalls. Others are monitoring tools.
36. C
#!/bin/bash is the shebang for Bash scripts. It tells the kernel which interpreter to use.
37. A
ntpq queries NTP daemon status. Others are unrelated.
38. D
$# holds the number of command-line arguments passed to the script.
39. A
lsof (list open files) or fuser audits open files/ports/sockets.
40. D
source (or .) executes commands in the current shell environment (useful for setting variables).
41. C
IPv6 link-local addresses begin with fe80:: (auto-configured on interfaces).
42. D
ssh -L (local) or -R (remote) forwards ports over SSH tunnels.
43. A
User crontabs or /etc/crontab define recurring cron jobs.
44. C
Shadow passwords separate sensitive hashes into /etc/shadow, protecting them from non-root users.
45. B
ip route add default via <gateway> sets the default gateway (modern iproute2).
46. B
/24 = 255.255.255.0 subnet mask (24 network bits).
47. B
/etc/resolv.conf specifies DNS nameservers for the resolver.
48. D
hwclock manages the hardware (RTC) clock. date is software clock.
49. B
anacron uses /etc/anacrontab to run periodic jobs even if the system was off.
50. D
BSD and MIT licenses are permissive (minimal restrictions on reuse).
51. C
chage modifies password aging policies (expiry, min/max days).
52. B
GnuPG (gpg) is used for encryption, signing, and key management.
53. D
/usr/share/zoneinfo/ contains timezone definition files (symlinked to /etc/localtime).
54. A
Edit /etc/aliases then run newaliases to update the alias database for Postfix/Sendmail.
55. D
TCP is connection-oriented and provides reliability (acknowledgments, retransmission). UDP is connectionless.
56. C
TMOUT variable sets idle timeout (automatic logout) for shells.
57. A
/etc/skel contains template files copied to new users’ home directories.
58. D
which shows the full path of a command found in $PATH.
59. D
Open source provides source code access and thrives on community contributions.
60. C
timedatectl is the modern systemd command for setting date/time/timezone.
Scoring Guide
- 52-60: Excellent – ready for the exam.
- 42-51: Good – review weak areas with hands-on practice.
- Below 42: Study official objectives + practice in a Linux VM.
Review the concepts, practice the commands on a Linux system and refer to official LinuC documentation. Good luck with your exam preparation.
Further Reading
- 中島, 能和: Linux教科書 LinuCレベル1 Version 10.0対応. 翔泳社, 20258.
The LinuC Series
Article 1: LinuC-1 Exam 101 v10.0 Command Cheat Sheet. https://www.modernsamurai.info/101
Article 2: LinuC-1 Exam 101 v10.0: 60-Question Practice Exam. https://www.modernsamurai.info/lcp60
Article 3: LinuC-1 Exam 101 v10.0: 20-Question Practice Exam. https://www.modernsamurai.info/lcp20
Article 4: LinuC Level1 Exam 102 Version 10.0 Cheat Sheet. https://www.modernsamurai.info/102
Article 5: LinuC Level1 Exam 102 Version 10.0 Practice Quiz (20 Questions). https://www.modernsamurai.info/lcq20
Article 6: LinuC Level1 Exam 102 Version 10.0 Practice Quiz (60 Questions). https://www.modernsamurai.info/lcq60
Article 7: LinuC Level1 Exam 102 Version 10.0 Practice Quiz (60 Questions With Explanations). https://www.modernsamurai.info/lcq60e

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.