A command-line based User Management System built using Python.
The application supports secure authentication, role-based access control, and admin-managed user operations with persistent storage.
- Secure login using SHA-256 password hashing
- Hidden password input using getpass
- First-run admin bootstrap
- Session-based login handling
- Admin and User roles
- Strict authorization enforcement
- Users cannot access admin features
- Create users (with role assignment)
- View all users (passwords hidden)
- Update user role or password
- Delete users with safety checks
- Cannot delete self
- Cannot delete last remaining admin
- View own profile
- Change own password securely
- Logout safely
- JSON-based persistent storage
- Input validation and error handling
- Graceful program exit
cli-user-management/ │ ├── main.py # Application entry point ├── storage.py # JSON load/save utilities ├── users.json # Persistent user data ├── README.md └── .gitignore
- Python 3.x
git clone <your-repo-url>
cd cli-user-management
python main.py
On first run, you will be prompted to create an admin account.
🧪 Sample Flow
Welcome to CLI User Management System
1. Login
2. Exit
Login successful!
Welcome admin
--- Admin Menu ---
1. Create User
2. View Users
3. Update User
4. Delete User
5. Logout
🧠 Key Learnings
Python CLI application design
Secure password handling
Role-based authorization
File-based persistence
Clean modular coding practices
📌 Future Improvements
Login attempt limits
Activity logs
Export users
Web version using Flask/FastAPI
👨💻 Author
Sooraj Suresh