As a SysOps engineer, you have been tasked to write a bash script that creates a Users, Groups, and home directories with appropriate permissions for new employees in your company
Read my article for the detailed solution
- Clone this repository on your Ubuntu machine using:
git clone <repo-link>
- Execute the file by running
sudo chmod +x create_users.sh
- Ensure you have an input file ready as it an argument to run the script. Your input file should be in the format below:
light; sudo,dev,www-data
idimma; sudo
mayowa; dev,www-data
Usernames and user groups are separated by semicolon ";"- Ignore whitespace. A user can have multiple groups, each group delimited by a comma.
save the input file by whatever name you prefer, e.g., input.txt
.
- Run the script. Ensure your user has sudo privileges before running:
bash create_users.sh input.txt