LFCS Mock Exam 2
This is a second mock exam for LFCS covering all major topics: Operations, Networking, Storage, Essential Commands, and Users & Groups.
Instructions
- Complete the exercises without looking at the answers.
- Answers are provided at the end of the document.
Part 1: Operations & Deployment
- Temporarily disable a kernel module
usb_storageand verify it is no longer in use. - List all currently loaded kernel modules and identify one used by the system audio.
- Schedule a one-time job to run
/usr/local/bin/update_logs.shin 15 minutes. - Check system boot messages for any hardware errors.
Part 2: Networking
- Configure interface
eth1to use DHCP. - Verify DNS resolution for
example.com. - Open port 8080 for TCP connections and make the change persistent.
- Create a bonding device
bond0using interfaceseth0andeth1.
Part 3: Storage
- Create a new 5 GB logical volume
lv_backupin volume groupvg01. - Format it with XFS and mount it at
/mnt/backup. - Add a new swap partition on
/dev/sdc1and activate it. - Mount a CIFS share
//server/shareon/mnt/cifswith credentials stored securely.
Part 4: Essential Commands
- Monitor memory usage in real-time and identify the process using the most memory.
- Find all
.logfiles larger than 50 MB in/var/log. - Generate a private key and CSR for a certificate signing request.
- Clone a Git repository, create a new branch
feature1, and push it to the remote.
Part 5: Users & Groups
- Create a system user
service1without login permissions. - Set a hard limit of 10 processes for user
developer1. - Set ACL so that group
developershas read/write access to/opt/project/config.yml. - Configure the system to authenticate users against an LDAP server and verify an LDAP user.
Answers (Do not read until done!)
Part 1: Operations & Deployment
sudo modprobe -r usb_storagelsmod | grep usb_storage(should show nothing)lsmod | grep snd(example:snd_hda_intel)echo "/usr/local/bin/update_logs.sh" | at now + 15 minutesdmesg | lessorjournalctl -b
Part 2: Networking
sudo nmcli con mod eth1 ipv4.method autosudo nmcli con up eth1dig example.comornslookup example.comsudo firewall-cmd --permanent --add-port=8080/tcpsudo firewall-cmd --reloadsudo nmcli con add type bond con-name bond0 ifname eth0,eth1 mode active-backup
Part 3: Storage
sudo lvcreate -L 5G -n lv_backup vg01sudo mkfs.xfs /dev/vg01/lv_backupsudo mkdir -p /mnt/backupsudo mount /dev/vg01/lv_backup /mnt/backupsudo mkswap /dev/sdc1sudo swapon /dev/sdc1sudo mount -t cifs -o credentials=/root/.cifs_credentials //server/share /mnt/cifs
Part 4: Essential Commands
htoportopand sort by memory usagefind /var/log -type f -name "*.log" -size +50Mopenssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csrgit clone <url>cd <repo>git checkout -b feature1git push -u origin feature1
Part 5: Users & Groups
sudo useradd -r -s /usr/sbin/nologin service1- Add to
/etc/security/limits.conf:developer1 hard nproc 10 setfacl -m g:developers:rw /opt/project/config.yml- Install and configure LDAP client (
libnss-ldap,libpam-ldap) Verify:getent passwd ldapuser