Master Linux Fundamentals: A Hands‑On Lab Guide for Home, Work, and Exams
This step‑by‑step Linux fundamentals guide walks you through selecting and installing multiple distributions, configuring users, permissions, filesystems, software, networking, scripting, and system services, providing practical tasks that prepare you for personal projects, workplace duties, and certification exams.
01 Choose a Linux Distribution
Select a distribution that matches your learning goals. For experimental work you can install CentOS Stream or Fedora on a spare PC, a Raspberry Pi, a virtual machine, or a container. For a stable, enterprise‑grade environment install Red Hat Enterprise Linux (RHEL) and later migrate to production. All three are Fedora‑derived, so installation steps are similar. Reference guide:
https://www.redhat.com/sysadmin/introduction-red-hat-enterprise-linux-8.
02 Install at Least Three Distributions
Create five partitions: /boot, /var, /home, swap, and the root filesystem. Leave at least 100 MiB of unallocated space for future tasks.
During installation choose a desktop GUI (GNOME, KDE, etc.) for each distribution.
Create a regular user account and grant it sudo privileges.
After installation explore built‑in help resources:
Read the fstab manual page ( man 5 fstab).
Focus on sections 1 (general commands), 5 (file formats), and 8 (system administration).
Search manual pages with man -k keyword or apropos keyword.
Browse /usr/share/doc for package documentation.
Open any GUI help menus provided by the desktop environment.
Complete the vimtutor (or nano) tutorial to become comfortable editing files.
Configure the time zone with tzselect.
Designate one machine as the server and another as the client for later network exercises.
03 Adjust User Permissions
Log in with the user created during installation; use sudo for any system‑wide administrative task.
Edit /etc/sudoers with visudo to fine‑tune which commands the user may run without a password.
04 Use Text Editors
With vim, draft a personal Linux learning plan that lists the tasks you intend to complete.
With nano, list three or more learning resources (books, websites, videos).
Using a GUI editor (only once), list three Linux skills you feel confident about and three you need to improve.
05 Manage Users and Groups
Define default configuration files in /etc/skel before creating new users.
Set password policies in /etc/login.defs so passwords expire after 90 days with a 5‑day warning.
Create five user accounts (all sharing the same password) via useradd and passwd.
Create five groups—sales, marketing, HR, IT, engineering—using groupadd and add one user to each group with usermod -aG.
Delegate the ability to reboot the system to a single user by adding a NOPASSWD entry for /sbin/reboot in /etc/sudoers.
06 Manage Files
Create top‑level directories for each department: /sales, /marketing, /hr, /it, /engineering.
Set standard permissions so only the owning group can read/write its directory (e.g., chmod 2770 /sales and chown root:sales /sales).
Configure ACLs:
setfacl -m g:marketing:r /sales
setfacl -m u:someuser:r /itApply SGID and the sticky bit on /marketing ( chmod 2771 /marketing) and verify that users cannot delete each other’s files.
Create an immutable file unchangeable.txt ( touch unchangeable.txt && chattr +i unchangeable.txt) and confirm that removal is blocked.
Create a hard link:
echo "test" > /opt/LinksTest.txt
ln /opt/LinksTest.txt /tmp/LinksTest.txt
cat /tmp/LinksTest.txtCreate a symbolic link in /root pointing to /tmp/LinksTest.txt ( ln -s /tmp/LinksTest.txt /root/LinksTestLink) and test access after deleting the original file.
Generate ten files in /tmp, archive and compress them:
cd /tmp
for i in {1..10}; do touch file${i}.txt; done
tar -cvf files.tar *.txt
gzip files.tar
rm *.txt
gzip -d files.tar.gz
tar -xvf files.tarUse find to locate the test files as root, as a group member, and as a non‑member to observe permission effects.
Mount an ISO image:
mkdir /mnt/iso
mount -o loop /path/to/image.iso /mnt/iso
cp -r /mnt/iso/* /desired/location
umount /mnt/isoConfigure LVM:
pvcreate /dev/sdb1 /dev/sdb2
vgcreate vg_lab /dev/sdb1 /dev/sdb2
lvcreate -L 100M -n lv_data vg_lab
mkfs.ext4 /dev/vg_lab/lv_data
mkdir /mnt/lv_data
mount /dev/vg_lab/lv_data /mnt/lv_data
echo '/dev/vg_lab/lv_data /mnt/lv_data ext4 defaults 0 2' >> /etc/fstab07 Manage Software
List all installed RPM packages and redirect the list to a file: rpm -qa > installed_packages.txt Install an RPM package (e.g., zsh) and later remove it, retrieving package info before removal:
dnf install -y zsh
rpm -qi zsh
dnf remove -y zshInstall and query another package with dnf (e.g., ksh) and then uninstall it.
Clone a source repository, compile the code, and verify integrity with an MD5 checksum:
git clone https://github.com/example/project.git
cd project
make && make install
md5sum source.tar.gz
# compare with the published checksum08 Boot to CLI and GUI
Configure a machine to boot to the command‑line interface by setting the default systemd target:
systemctl set-default multi-user.target
rebootStart the graphical interface on demand without changing the default target: systemctl start graphical.target On a virtual machine, change the default target to graphical.target, reboot, verify GUI boot, then switch back to multi-user.target and verify CLI boot.
09 Manage Hardware Information
Record hardware details using the following commands and redirect each output to a separate file:
df -h > df.txt
du -sh / > du.txt
cat /proc/cpuinfo > cpuinfo.txt
cat /proc/meminfo > meminfo.txt
lsblk > devices.txt
fdisk -l > partitions.txt
ifconfig -a > ifconfig.txt
ip addr show > ipaddr.txt
cat /etc/fstab > fstab.txt
uname -a > uname.txtSave dmesg output and extract lines containing "memory" or "CPU":
dmesg > dmesg.txt
grep -i -e memory -e cpu dmesg.txt > dmesg_filtered.txt10 Create Scripts
Find at least three useful simple scripts online (e.g., backup, system‑status, log‑rotate).
Explain that prefixing a script execution with ./ runs the script from the current directory, and that the shebang line (e.g., #!/bin/bash) tells the kernel which interpreter to use.
Edit scripts with vim (no GUI editors).
Reference articles for Bash learning:
https://opensource.com/article/20/12/learn-bash
https://opensource.com/downloads/bash-scripting-ebookCreate a backup script that archives the department directories:
#!/bin/bash
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
tar -czf /backup/departments_$TIMESTAMP.tar.gz /sales /marketing /hr /it /engineeringSchedule the backup script to run hourly with cron:
crontab -e
0 * * * * /path/to/backup.shAfter confirming it works, remove the cron entry.
Initialize a Git repository on GitHub and push the scripts for version control:
git init
git add backup.sh other_script.sh
git commit -m "Add backup script"
git remote add origin https://github.com/youruser/linux-lab-scripts.git
git push -u origin master11 Configure System and Network Services
Record the seven OSI model layers.
Save the IP and MAC address of a Linux system in ~/networking.txt and note the IP class.
ip -brief address > ~/networking.txt
cat /sys/class/net/*/address >> ~/networking.txtEdit /etc/hosts on a VM to enable name‑based ping.
Establish SSH connections between two or more VMs, configure key‑based authentication, and set a banner message in /etc/ssh/sshd_config (e.g., Banner /etc/issue.net).
Run traceroute 8.8.8.8 and tracepath 8.8.8.8, saving outputs to ~/traceroutegoogle.txt.
Configure one VM as a DHCP server with a static IP (using dhcpd or dnsmasq) and another as a DHCP client; verify connectivity with ping.
Open firewall ports for HTTP and FTP using the appropriate firewall tool (e.g., firewall-cmd --add-service=http --permanent and --add-service=ftp), then reload the firewall.
Install and enable the Apache web server:
dnf install -y httpd
systemctl enable httpd
systemctl start httpdEnsure it starts in both multi-user.target and graphics.target.
Create a simple index.html in /var/www/html and verify access from other VMs.
Display Apache process information: ps -ef | grep httpd Install and enable vsftpd, create a test FTP directory, and verify file download:
dnf install -y vsftpd
systemctl enable vsftpd
systemctl start vsftpd
mkdir -p /var/ftp/pub
chmod 755 /var/ftp/pubReview rsyslog logs for HTTP and FTP services (e.g., /var/log/httpd/error_log, /var/log/vsftpd.log).
Customize the GRUB2 menu to display a custom entry "MyLinuxDistro" by editing /etc/default/grub and running grub2-mkconfig -o /boot/grub2/grub.cfg.
Adjust process priority with top (press r and enter the PID and new nice value).
Use systemd-analyze blame to identify the three services with the longest startup times and record the results.
Record CPU model name from /proc/cpuinfo and total memory from /proc/meminfo.
12 Recover a Forgotten Root Password
Interrupt the GRUB2 boot process, edit the kernel line to append init=/bin/bash, boot into a root shell, remount the root filesystem as read‑write ( mount -o remount,rw /), and reset the root password with passwd. Note that this method does not work on systems with full‑disk encryption.
13 Explore GUI Options
Investigate the various desktop environments and GUI tools available for each installed distribution (GNOME, KDE Plasma, Xfce, LXQt, etc.). Document any familiar or useful features.
Identify open‑source applications that run on Linux for music production, gaming, digital photography, and image editing (e.g., Ardour, Steam, Darktable, GIMP).
Read the descriptions of Fedora Spins to understand the range of pre‑configured desktop environments.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
