REPORT
Report Title: Week 02 Task
Submitted By: Muniba Khan
Submitted To: Sir Adil
Nastap Alpha techno square
Week 2: User and Permission Management
Tasks:
Detailed study of user and group management.
Understanding and configuring file permissions and ownership.
Access control using ACLs.
Introduction to sudo and root access.
Task#1
Detailed study of user and group management
1. User and Group Management
Users:
A user account represents a single individual or entity that can log into and use a computer system. Each
user account has a unique username and a user ID (UID).
Types of Users:
Root User: The root user has owner having full access to a system.
Regular Users: They have restricted permissions based on their roles.
System Users: These accounts are used by system processes and services.
Groups:
Definition: A group is a collection of user accounts. Groups are used to simplify the management of
permissions for multiple users.
Types of Groups:
Primary Group: Each user is assigned to a primary group, which is specified in the user's
account details.
Secondary Groups: Users can be members of additional groups, which provide extra
permissions on the system.
1. User and Group Management
Creating a User: sudo adduser john
Deleting a User: sudo deluser john
Creating a Group:
sudo addgroup developers Add user to a group
Change username: Deleting a Group:
2. File Permissions and Ownership
File Permissions:
Permissions determine who can read, write, or execute a file.
Types of Permissions:
Read (r): Permission to read the contents of the file.
Write (w): Permission to modify the file.
Execute (x): Permission to execute the file (for scripts and binaries).
Ownership:
Owner: The user who owns the file.
Group: The group that owns the file.
Others: Users who are neither the owner nor part of the group.
I have studied that format of permission represented as a string of 10 characters (-rwxr-xr--),
where the first character indicates the type of file and the rest show permissions for the owner,
group, and others.
File Permissions and Ownership
Creating a File
Change ownership
Change Permissions with Superuser Privileges:
Owner: rwx (7) Group: r-x (5) Others: r-- (4)
3. Access Control Lists (ACLs)
ACLs provide a more granular permission mechanism beyond the traditional Unix file
permissions, allowing specific permissions for individual users or groups.
Commands:
3. Access Control Using ACLs
Installing ACL Tools (if not already installed):
Give user doe read and write permissions:
Check ACL Support on a File System
List All ACLs on the System:
List All Groups with ACLs on a Directory:
Created a access control list:
Scenario: Managing Access with ACLs
You are a Linux administrator responsible for securing a server that contains sensitive financial
data. Your task is to implement Access Control Lists (ACLs) to restrict access to these files based
on specific user roles.
Identify Sensitive Directory:
Grant Access to Finance Team
Restrict Access to Non-Finance Users
Task 2: Monitoring ACL Changes
View Current ACL Settings
Monitor ACL Modifications
Regularly review user access rights and adjust ACLs accordingly to ensure compliance with the
principle of least privilege.
Checking ACLs on a Directory:
List Open Ports and Associated Programs
4. Sudo and Root Access
Root Access:
The root user has unrestricted access to the system, which includes the ability to modify any file
and perform any administrative task.
Sudo:
• sudo allows permitted users to execute commands as the superuser or another user, as
specified by the security policy.
sudo command: Run a command as root.
sudo -u username command: Run a command as a specified user.
1. Root Access
Command: Switch to root user interactively:
Interesting Usage
Root access on Unix-like systems such as Linux grants the user unrestricted control over the
entire operating system, allowing them to modify critical system files, install software, and
execute any command. This level of access is crucial for system administration tasks but comes
with significant security risks if misused