Skip to content

Users, passwords, shadow file, ulimit, and basic file operations | Project 2 of 3 in Linux System Management series

Notifications You must be signed in to change notification settings

CarlosSemeao/linux-system-management-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

🔐 linux-system-management-2

Project 2 of 3 in the Linux System Management series
Focus: Shadow file, user states, password locks, ulimit, and file ops


📌 Objectives

  • Understand Linux user authentication and shadow file structure
  • Analyze locked, disabled, and unset passwords in /etc/shadow
  • Practice safe file operations using mv -u and mkdir -p
  • Configure and verify user limits with ulimit

📁 Project Structure

linux-system-management-2/
├── README.md
├── outputs/
│   ├── 01a-shadow-passwd-d.txt
│   ├── 01b-shadow-passwd-l.txt
│   ├── 02-ulimit-output.txt
│   ├── 02b-ulimit-focused.txt
│   ├── 02c-ulimit-test-dd.txt
│   ├── 03-mv-test-output.txt
│   └── 04-mkdir-test-output.txt
└── screenshots/
    ├── 01a-passwd-d-shadow.png
    ├── 01b-passwd-l-shadow.png
    ├── 02-ulimit-output.png
    ├── 02b-ulimit-focused.png
    ├── 02c-ulimit-test-dd.png
    ├── 03-mv-test-output.png
    └── 04-mkdir-test-output.png

⚙️ Command Execution & Results

1️⃣ Examine /etc/shadow Password States

# Create user and remove password
sudo useradd testuser1
sudo passwd -d testuser1
sudo grep testuser1 /etc/shadow

# Lock the user account
sudo passwd -l testuser1
sudo grep testuser1 /etc/shadow

📷 01a-passwd-d-shadow
📷 01b-passwd-l-shadow


2️⃣ Set and View ulimit Resource Limits

ulimit -a
ulimit -u
ulimit -n

📷 02-ulimit-output
📷 02b-ulimit-focused


🧪 Deep Dive: Enforcing File Size Limit with ulimit -f

To simulate a file size enforcement scenario, I temporarily limited the shell's max file size:

ulimit -f 100
dd if=/dev/zero of=testfile bs=1M count=2

📸 02c-ulimit-test-dd

✅ This triggered the expected failure:
File size limit exceeded (core dumped)

Restored default limit afterward:

ulimit -f unlimited
rm -f testfile

3️⃣ Test mv -u (Move if Newer)

echo "I am older" > oldfile.txt
sleep 2
echo "I am newer" > newfile.txt
mv -u newfile.txt oldfile.txt
cat oldfile.txt

📷 03-mv-test-output

✅ Confirmed that the content of oldfile.txt was replaced only because newfile.txt was newer.


4️⃣ Test mkdir -p (Recursive Directory Creation)

mkdir -p /tmp/testdir1/testdir2/testdir3
ls -R /tmp/testdir1

📷 04-mkdir-test-output

✅ Demonstrated ability to create nested directory trees in a single command.


✅ Summary

This project reinforces Linux+ exam skills around user account management, shadow file analysis, and essential file operations.
Screenshots and command outputs offer a complete trace of each concept in practice.


🧠 Next Project

linux-system-management-3
Focus: SSH, PXE, DNS, name resolution, and network boot behavior

About

Users, passwords, shadow file, ulimit, and basic file operations | Project 2 of 3 in Linux System Management series

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published