Skip to content

CarlosSemeao/linux-system-management-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Linux System Management 2

Shadow file - user states - password locks - ulimit - file


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

Tree

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

Execution

Examine /etc/shadow

# 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


Resource Limits

ulimit -a
ulimit -u
ulimit -n

02-ulimit-output
02b-ulimit-focused


Enforcing File Size

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

02c-ulimit-test-dd

Failure:
File size limit exceeded (core dumped)

Restored default limit afterward:

ulimit -f unlimited
rm -f testfile

Test

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

Content of oldfile.txt replaced only because newfile.txt was newer.


Recursive Directory Creation

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

04-mkdir-test-output

Nested directory trees


Summary

Linux+ around user account management, shadow file analysis and essential file operations.


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

 
 
 

Contributors