WEEK 2 Linux Hands-On
Task 1 : User & Group Management
To create a user use command —> sudo useradd <user_name>
To create a group use command —> sudo groupadd <group_name>
To add user in a group use command —> sudo usermod -aG <group_name> <user_name>
Set a password and grant sudo access.
Restrict SSH login for certain users in
/etc/ssh/sshd_config
.Task 2 : File & Directory Permissions
permission
Task 3 : Log File Analysis with AWK, Grep & Sed
Use
grep
to find all occurrences of the word "error".- Use
awk
to extract timestamps and log levels.
- Use
Use
sed
to replace all IP addresses with [REDACTED] for security.Task 4 : Volume Management & Disk Usage
Create a directory
/mnt/devops_data
Verify using
df -h
andmount | grep devops_data
Task 5: Automate Backups with Shell Scripting
To create a shell script to back up
/devops_workspace
asbackup_$(date +%F).tar.gz
.Save it in
/backups
and schedule it usingcron