Sure, here's a simple README for your GitHub repository:
This script automates the creation of users and groups on a Linux system based on input from a text file. It generates random passwords for the users, sets up their home directories, and logs all actions taken. Additionally, it ensures secure storage of the generated passwords.
- Create users and their home directories.
- Create groups and assign users to them.
- Generate random passwords for users.
- Log all actions to a log file.
- Store passwords securely.
To successfully run this script, you need the following:
- A Linux machine with root privileges.
- Basic knowledge of Bash commands and scripting.
- A text editor of choice (vi, nano, vim, etc).
-
Clone the repository:
git clone git@github.com:0xSimeon/linux-user-groups-management.git cd linux-user-groups-management
-
Ensure the script has execute permissions:
chmod +x create_users.sh
-
Prepare your input file (
users.txt
) with the following format:username;group1,group2,...
Example:
nelson;cloudeng,sre victor;backend john;qa jane;dev,manager robert;marketing emily;design,research michael;devops olivia;design,research william;support sophia;content,marketing daniel;devops,sre ava;dev,qa
-
Run the script:
sudo ./create_users.sh users.txt
The script logs its actions to /var/log/user_management.log
.
The generated passwords are stored securely in /var/secure/user_passwords.txt
. Ensure this file is protected and accessible only by root.
For a detailed explanation of the script, its features, and how it works, please refer to the technical article here.
This project is licensed under the MIT License.