Lab 2: Security Management
Objective:
- To understand and practice security management tasks on a Linux system.
Topics Covered:
- File Permissions and Ownership
- sudo Configuration
- SSH Configuration
- Firewall Management (using
ufw
) - File Integrity Checking (using
tripwire
)
Lab Exercises:
Exercise 1: File Permissions and Ownership
- Create a file named
secure_file.txt
in the home directory. - Restrict read and write permissions to the owner only.
- Allow read permissions to the group.
- Deny all permissions to others.
- Change the owner of the file to a different user.
Exercise 2: sudo Configuration
- Add a new user named
admin
to the sudo group. - Verify that the
admin
user can execute commands with sudo. - Edit the sudoers file to allow a specific user to run a command without entering a password.
Exercise 3: SSH Configuration
- Change the default SSH port from 22 to a custom port.
- Disable password-based authentication for SSH.
- Generate SSH key pairs for two users (
user1
anduser2
). - Allow only specific users to log in via SSH.
Exercise 4: Firewall Management (using ufw)
- Enable the UFW (Uncomplicated Firewall) service.
- Allow incoming SSH connections.
- Allow incoming connections on a custom service/port (e.g., web server).
- Deny incoming connections from a specific IP address.
- Disable the UFW service.
Exercise 5: File Integrity Checking (using tripwire)
- Install
tripwire
on the system. - Initialize the
tripwire
database. - Run a manual check of file integrity.
- Modify a system file and run another integrity check to detect changes.
- Review
tripwire
reports and logs.
Lab Documentation:
Provide detailed instructions for each exercise, including command syntax and expected outcomes. Include explanations of the purpose behind each security task.