Untitled Document
Untitled Document
The Unix file system is a tree-like structure that starts from the root directory (/). It
organizes files and directories, allowing easy navigation and access control. Permissions
help secure files by defining access for the owner, group, and others.
1.
2.
3.
cd → Change directory.
sh
CopyEdit
cd SEIT
4.
5.
6.
2.
3.
5.
6.
7.
1.
2.
3.
4.
5.
6.
7.
8.
9.
Summary
O
Search
Reason
Unix allows multiple users to use the system while keeping everything secure. User
management helps system administrators:
✔ Create, modify, and delete users.
✔ Manage groups and permissions.
✔ Set password policies and control access.
Key Concepts
1. User Accounts – Every user has a username and a User ID (UID).
2. Groups – A collection of users with shared permissions.
3. Superuser (Root) – The admin user with full access.
4. File Ownership & Permissions – Decide who can read, write, or execute files.
Important Commands
Command Purpose
● Command: whoami
● Purpose: Shows the currently logged-in user.
● Command: who
● Purpose: Lists all users currently logged in.
●
○ sudo → Runs as an administrator.
○ useradd → Creates a new user.
○ -m → Creates a home directory.
● Expected Output: Shows user details like home directory and shell.
Set Password:
sh
CopyEdit
sudo passwd testuser
●
○ Switches to testuser.
Verify:
sh
CopyEdit
whoami
●
●
○ Adds testuser to the sudo (admin) group.
●
●
Verify:
sh
CopyEdit
groups testuser
Delete a Group:
sh
CopyEdit
sudo groupdel testgroup
●
Verify:
sh
CopyEdit
cat /etc/group | grep testgroup
●
Check Ownership:
sh
CopyEdit
ls -l testfile.txt
●
●
Verify:
sh
CopyEdit
ls -l testfile.txt
●
●
Verify:
sh
CopyEdit
sudo chage -l testuser
●
●
●
● Purpose: Exit the current session.
Summary of Commands
Action Command