This project is a bash-based user management system created as part of a shell scripting course. It provides a menu-driven interface for managing users on a Linux system and includes error handling and permission checks.
The script supports the following user management operations:
- Show System Information
- List Users with
/bin/bashShell - Search for a User
- Add a New User
- Delete a User (with Home Directory Backup)
- Show User Details
- Change User Password
- Lock a User Account
- Unlock a User Account
- Exit the Program
Each operation is handled through individual functions for modularity and clarity.
- The menu reappears after each operation.
- Users can interactively choose actions from the list.
The script includes handling for the following edge cases:
- Invalid input detection
- User existence verification
- Backup directory validation
- Permission checks (
sudo/root requirement)
usersManagementSystem/ β βββ usermanag.sh # Main interactive script βββ manage_functions.sh # All function definitions βββ README.md # Project documentation βββ project_nustructions.png # Project Instructions
- Must be run as
root(UID 0) - Bash shell environment (tested on Ubuntu)
- Mail utils installed for future enhancements (e.g., user notifications)
- Clone the repository: git clone https://github.com/yourusername/user-management.git cd user-management Make the scripts executable: chmod +x main.sh user_functions.sh Run the main script with root privileges: sudo ./main.sh
User Management System
- Show System Information
- List Users with /bin/bash Shell
- Search for a User ...
- Exit
Enter your choice [1-10]: π Notes Backup files will be stored in a backup/ directory inside the script folder (can be changed).
Ensure proper permissions and disk space for user backups.
π License This project is provided as-is for educational purposes. Feel free to fork and improve it!