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