kryptalabs / module-admin-password-cli
Magento 2 module for changing admin passwords via CLI with email verification
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:magento2-module
Requires
- php: ~7.4.0||~8.0.0||~8.1.0||~8.2.0||~8.3.0
- magento/framework: >=103.0.0
- magento/module-user: >=101.0.0
README
A Magento 2 module that provides a secure CLI command to change admin user passwords. This module adds an extra layer of security by requiring email verification during the password change process.
Features
- 🔐 Secure password changing via CLI
- ✉️ Email verification to identify the correct admin user
- 🛡️ Input validation and error handling
- 📝 Detailed success/error messaging
Requirements
- Magento 2.3.x, 2.4.x
- PHP 7.4 or higher
Installation
Using Composer (Recommended)
composer require kryptalabs/module-admin-password-cli bin/magento module:enable Kryptalabs_AdminPasswordCli bin/magento setup:upgrade bin/magento cache:flush
Manual Installation
-
Create the following directory structure in your Magento installation:
app/code/Kryptalabs/AdminPasswordCli/
-
Download the module and copy the contents to the directory.
-
Enable the module:
bin/magento module:enable Kryptalabs_AdminPasswordCli bin/magento setup:upgrade bin/magento cache:flush
Usage
The module adds a new CLI command to change admin passwords:
bin/magento admin:user:password:change -u admin_username -p new_password -e admin_email
Command Options
Option | Short | Required | Description |
---|---|---|---|
--username | -u | Yes | Admin username |
--password | -p | Yes | New password |
-e | Yes | Admin email address |
Examples
Change password for a specific admin user:
bin/magento admin:user:password:change --username adminuser --password newPassword123 --email admin@example.com
Using short options:
bin/magento admin:user:password:change -u adminuser -p newPassword123 -e admin@example.com
Error Handling
The command includes comprehensive error handling for various scenarios:
- Missing required options
- User not found
- Email mismatch
- Invalid password format
- Database errors
Security
- Passwords are securely hashed using Magento's native password hashing mechanism
- Email verification prevents unauthorized password changes
- CLI-only access adds an extra layer of security
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Support
If you encounter any issues or have questions, please:
- Check the Issues page
- Submit a new issue if your problem isn't already listed
- For urgent support, contact [divyesh@kryptalabs.com]
Author
- GitHub: @divyesh-thadani
- Email: divyesh@kryptalabs.com
Changelog
1.0.0
- Initial release
- Basic password change functionality
- Email verification feature
- Error handling implementation
⭐ Found this useful? Show your support by giving this repository a star on GitHub!