All Linux Foundation / CNCF exams
Free LFCA practice test: 30 questions with answers
30 original questions for Linux Foundation Certified IT Associate, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 100 questions
All 30 LFCA questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
Linux fundamentals (5 questions)
Question 1
Which component of a Linux system is responsible for managing hardware resources and providing services to applications?
- AThe desktop environment
- BThe kernel
- CThe shell only
- DThe web browser
Show answer and explanationHide answer
Correct answer: BThe kernel manages hardware and provides system services. The shell is an interface, the desktop environment is a user interface, and the browser is an application.
Question 2
Which command displays the current working directory?
- Apwd
- Bls
- Ccd
- Dcat
Show answer and explanationHide answer
Correct answer: Apwd prints the working directory. ls lists files, cd changes directories, and cat displays content.
Question 3
A user wants to know which version of the Linux kernel is running. Which command shows it?
- Adf -h
- Btop
- Cwhoami
- Duname -r
Show answer and explanationHide answer
Correct answer: Duname -r shows the running kernel release. whoami shows the user, df reports disk space, and top shows processes.
Question 4
In Linux file permissions, what does the execute bit mean for a directory?
- AThe directory is hidden
- BThe directory is encrypted
- CThe user can enter the directory and access files within it, given the other permissions
- DThe directory can be executed as a program
Show answer and explanationHide answer
Correct answer: CFor directories, execute allows traversal into the directory. Directories are not executed as programs, and the bit does not hide or encrypt them.
Question 5
Which file contains the list of user accounts on a typical Linux system?
- A/etc/issue
- B/etc/hosts
- C/etc/passwd
- D/etc/fstab
Show answer and explanationHide answer
Correct answer: C/etc/passwd lists user account entries. hosts maps names to IPs, fstab lists mounts, and issue holds a login banner.
Cloud and containers (5 questions)
Question 6
A team wants to package an application and its dependencies so that it runs the same way on any host with a container engine. Which technology provides this?
- ASpreadsheets
- BContainers
- CVirtual desktops
- DBare metal installs only
Show answer and explanationHide answer
Correct answer: BContainers package applications with dependencies for consistent execution. Virtual desktops, spreadsheets and bare-metal installs do not provide this packaging model.
Question 7
In cloud computing, which model provides virtual machines and storage that the customer manages, including the operating system?
- ADesktop as a Service only
- BFunction as a Service only
- CSoftware as a Service
- DInfrastructure as a Service
Show answer and explanationHide answer
Correct answer: DIaaS gives customers VMs and storage they manage including the OS. SaaS provides finished applications, FaaS runs functions, and DaaS delivers desktops.
Question 8
An organization wants to scale containerized applications automatically across many hosts with health management. Which platform is commonly used?
- AKubernetes
- BA text editor
- CA single desktop computer
- DAn email client
Show answer and explanationHide answer
Correct answer: AKubernetes orchestrates containers at scale with health management and scaling. Desktops, editors and email clients do not orchestrate containers.
Question 9
A container image is built from a file describing its steps. Which file is commonly used for this purpose?
- ALICENSE
- BREADME.md
- C/etc/hosts
- DDockerfile or Containerfile
Show answer and explanationHide answer
Correct answer: DDockerfile or Containerfile describe image build steps. README, LICENSE and hosts files do not define image builds.
Question 10
Which THREE are typical characteristics of containers compared with virtual machines? (Choose three.)
- AContainers share the host kernel
- BContainers cannot be scaled horizontally
- CContainers always include their own complete kernel
- DContainers typically start faster than full virtual machines
- EContainers package application dependencies without a full guest operating system
Show answer and explanationHide answer
Correct answer: A, D, EContainers share the host kernel, start quickly and package dependencies without a full guest OS. They include no separate kernel and can scale horizontally.
Networking (5 questions)
Question 11
Which protocol translates human-readable domain names into IP addresses?
- ASSH
- BHTTP
- CSMTP
- DDNS
Show answer and explanationHide answer
Correct answer: DDNS resolves domain names to IP addresses. HTTP serves web content, SMTP sends email, and SSH provides secure remote access.
Question 12
A system must obtain an IP address automatically when it joins a network. Which service provides this?
- ADHCP
- BNTP
- CDNS
- DSNMP
Show answer and explanationHide answer
Correct answer: ADHCP assigns IP addresses and related settings automatically. DNS resolves names, NTP synchronizes time, and SNMP monitors devices.
Question 13
A network administrator needs to check whether a remote host is reachable with ICMP echo requests. Which command is used?
- Ascp
- Bchmod
- Cping
- Dtar
Show answer and explanationHide answer
Correct answer: Cping sends ICMP echo requests to test reachability. scp copies files, tar archives files, and chmod changes permissions.
Question 14
A firewall policy must allow SSH from a single administrative subnet and block SSH from all other networks. Which principle does this apply?
- ALeast privilege for network access
- BShared credentials
- COpen access by default
- DAnonymous access
Show answer and explanationHide answer
Correct answer: ALimiting SSH to a single admin subnet applies least privilege for network access. Open defaults, anonymous access and shared credentials are contrary to the principle.
Question 15
Which TWO are benefits of using encrypted protocols such as SSH and HTTPS? (Choose two.)
- ARemoval of the need for authentication
- BGuaranteed speed improvement in every case
- CConfidentiality of data in transit
- DProtection against tampering in transit
- EAutomatic disabling of firewalls
Show answer and explanationHide answer
Correct answer: C, DEncryption protects confidentiality and integrity in transit. It does not guarantee speed, remove authentication, or disable firewalls.
Operating systems (5 questions)
Question 16
Which Linux distribution family is based on Red Hat Enterprise Linux and uses the RPM package format?
- AAlpine Linux only
- BDebian-based systems only
- CFedora-based systems such as RHEL, Rocky Linux, or AlmaLinux
- DArch Linux only
Show answer and explanationHide answer
Correct answer: CRHEL-family distributions such as Rocky and AlmaLinux use RPM packages. Debian and Arch use other formats, and Alpine uses APK.
Question 17
A system administrator needs to install a package on a Debian-based system. Which package manager should be used?
- Adnf
- Bzypper
- Capt
- Dpacman
Show answer and explanationHide answer
Correct answer: Capt manages Debian-based packages. dnf is for Red Hat-family systems, zypper is for SUSE, and pacman is for Arch.
Question 18
Which init or service manager is standard on most modern Linux distributions?
- Axinetd
- Bcron
- Csysvinit only
- Dsystemd
Show answer and explanationHide answer
Correct answer: Dsystemd is standard on most modern distributions for service management. cron is for scheduled jobs, sysvinit is legacy, and xinetd is an older super-server.
Question 19
A system must start a service automatically at boot on a systemd system. Which command achieves this?
- Asystemctl enable servicename
- Bkill servicename
- Csystemctl status servicename only
- Dls servicename
Show answer and explanationHide answer
Correct answer: Asystemctl enable configures a service to start at boot. Status shows state, kill sends signals, and ls lists files.
Question 20
Which mount point typically holds the operating system's configuration files?
- A/home
- B/etc
- C/tmp
- D/mnt
Show answer and explanationHide answer
Correct answer: B/etc holds system configuration. /home holds user data, /tmp holds temporary files, and /mnt is for mounting temporary file systems.
Security (5 questions)
Question 21
A user must create a strong password for a Linux account. Which guidance is most appropriate?
- AUse a long passphrase that is unique and not reused across accounts
- BUse the username as the password
- CUse a password shared with the team
- DUse a common word with a number at the end
Show answer and explanationHide answer
Correct answer: ALong, unique passphrases resist guessing and reuse risk. Usernames, shared passwords and simple common words are weak.
Question 22
A Linux administrator wants to disable direct root logins over SSH to reduce risk. Which setting does this?
- APort 22 only
- BPasswordAuthentication yes for root
- CAllowUsers root
- DPermitRootLogin no in the SSH daemon configuration
Show answer and explanationHide answer
Correct answer: DPermitRootLogin no disables direct root SSH login. Password settings, ports and allowing root do not disable direct root access.
Question 23
A security team wants to know which software packages have known vulnerabilities on a server. Which practice helps?
- AAssume all packages are safe because they are installed
- BCheck only the desktop wallpaper
- CUse the package manager's security update information and a vulnerability scanner
- DDisable updates to avoid breakage
Show answer and explanationHide answer
Correct answer: CPackage security information and scanners identify known vulnerabilities. Assumptions, wallpapers and disabled updates do not identify or fix known issues.
Question 24
A file on a shared server must be readable by a group and writable only by its owner. Which permission set matches this requirement?
- A444 for everyone
- B777 for everyone
- C640 with the group set appropriately
- D600 with no group read
Show answer and explanationHide answer
Correct answer: C640 gives owner read and write, and group read. 777 gives everyone write, 600 removes group read, and 444 gives no write to owner.
Question 25
Which TWO are good practices for managing user accounts on a shared Linux server? (Choose two.)
- AKeep old accounts enabled as backups
- BGive every user root privileges to avoid permission issues
- CShare the root password in the team wiki
- DUse individual accounts instead of sharing one login
- ERemove or lock accounts when people leave the organization
Show answer and explanationHide answer
Correct answer: D, EIndividual accounts and removing departed users' access are sound. Universal root, retained accounts and wiki-shared passwords are unsafe.
DevOps and IT operations (5 questions)
Question 26
A team wants every change to infrastructure to be tracked, reviewed, and reversible. Which practice supports this?
- APosting the changed settings in a team chat channel
- BMaking changes directly on live servers without records
- CKeeping the configuration in memory with no persisted copy on disk
- DInfrastructure as code stored in version control with reviews
Show answer and explanationHide answer
Correct answer: DInfrastructure as code in version control with review provides traceability and rollback. Direct server changes, memory-only configuration and chat sharing lack records.
Question 27
A continuous integration system automatically builds and tests code after each commit. Which benefit does this provide?
- AGuaranteed deployment to production
- BEarly detection of defects
- CRemoval of the need for testing
- DElimination of version control
Show answer and explanationHide answer
Correct answer: BCI detects defects early with automated builds and tests. It does not remove testing, guarantee production deployment, or replace version control.
Question 28
A deployment pipeline must install an application in staging before production. Which practice describes this sequence?
- APromoting the same tested artifact through environments
- BCopying files manually between servers
- CBuilding a new artifact for each environment without testing
- DDeploying directly to production first
Show answer and explanationHide answer
Correct answer: APromoting the same tested artifact ensures consistency. Separate untested builds, production-first deployment and manual copies introduce risk.
Question 29
An operations team wants to be alerted when CPU usage on a server stays above 90 percent for ten minutes. Which tool category provides this?
- ASpreadsheet calculation
- BWord processing
- CImage editing
- DMonitoring and alerting
Show answer and explanationHide answer
Correct answer: DMonitoring systems collect metrics and trigger alerts on thresholds. Word processing, image editing and spreadsheets do not.
Question 30
A system's logs are collected from many servers into one place so that they can be searched during an incident. Which practice is this?
- ADeleting logs weekly
- BLogging disabled for performance
- CCentralized logging
- DLocal-only logging
Show answer and explanationHide answer
Correct answer: CCentralized logging collects logs for search and correlation. Local-only logs, weekly deletion and disabled logging limit investigation.