Linux Assignment– 3
User and Group Permissions
Basic Questions
- Create a new user named ‘testuser’.
- Set a password for ‘testuser’.
- Create a new group named ‘testgroup’.
- Add ‘testuser’ to ‘testgroup’.
- Display all users on the system.
- Display all groups on the system.
- Check the groups a user belongs to.
- Change the primary group of a user.
- Create a file and change its ownership to ‘testuser’.
- Change the group ownership of a file to ‘testgroup’.
- Display the ownership and permissions of a file.
- Change file permissions to read-only for all users.
- Give execute permission to a script for the owner only.
- Remove write permission from a file for the group.
- Create a directory and set permissions to 755.
- Create a file and set permissions to 644.
- Use ‘chmod’ to modify file permissions.
- Use ‘chown’ to change file ownership.
- Use ‘chgrp’ to change group ownership.
- Check the default permissions of newly created files.
Intermediate Questions
- Create a user with a specific home directory.
- Create a group and assign multiple users to it.
- Set a user’s shell to /bin/bash.
- Lock and unlock a user account.
- Create a shared directory for a group with proper permissions.
- Set a file to be executable only by group members.
- Use ‘usermod’ to modify user details.
- Use ‘groupmod’ to rename a group.
- Delete a user and remove their home directory.
- Delete a group from the system.
- Set a file to be accessible only by the owner.
- Create a directory with sticky bit set.
- Set a file with setuid permission.
- Set a file with setgid permission.
- Create a cron job for a user.
- Audit user login history.
- Restrict access to a file using ACLs.
- Grant read access to a file for a specific user using ACLs.
- Remove ACL permissions from a file.
- Check ACL settings of a file.
Advanced Questions
- Write a script to create multiple users and assign them to a group.
- Automate permission setting for a directory structure.
- Configure sudo access for a user.
- Restrict command execution using sudoers file.
- Monitor user activity using auditd.
- Set up a secure file sharing environment using groups and permissions.
- Create a script to backup user home directories.
- Implement user quota management.
- Configure PAM for password policies.
- Write a script to check and report permission issues in a directory.