[How To] Reset Webmin Password on Linux
This guide will show you how to reset your Webmin password. Webmin is a powerful, web-based interface for managing Unix-like servers. It simplifies many aspects of system administration. However, like any administrative tool, Webmin access is protected by a password. This guide explains the process of resetting your Webmin password if you’ve forgotten it or need to change it for security reasons. For more details on Webmin, you can visit the official Webmin website.
Table of Contents
- Introduction
- Understanding Webmin Password Management
- Resetting Webmin Password via Command Line
- Accessing the Server as Root or Superuser
- Security Considerations After Password Reset
- Conclusion
Introduction
Webmin offers a user-friendly way to manage your Linux server, handling tasks from configuring web servers to managing user accounts. Forgetting your Webmin password can lock you out of this essential tool. Fortunately, there’s a straightforward command-line method to regain access. This tutorial will guide you through the steps to reset your Webmin password across various Linux and Unix-like operating systems.
Understanding Webmin Password Management
Webmin stores its user configurations and encrypted passwords in specific files within its installation directory, typically in the /etc/webmin directory. The main utility for password management is a Perl script called changepass.pl. This script allows system administrators with root privileges to directly modify a user’s password without needing the old one.
This process requires direct command-line access to your server and sufficient permissions, usually root access, to execute the changepass.pl script.
Resetting Webmin Password via Command Line
The changepass.pl script’s exact path can vary slightly depending on your operating system. Below are the commands for common distributions to help you reset your Webmin password.
For RedHat-based Distributions (Fedora, CentOS, etc.)
On systems like Fedora or CentOS, the changepass.pl script is typically found in /usr/libexec/webmin/.
/usr/libexec/webmin/changepass.pl /etc/webmin admin your_new_secure_password
Remember to replace your_new_secure_password with a strong, unique password of your choice.
For Debian-based Distributions (Debian, Ubuntu, etc.)
For Debian and Ubuntu systems, you will usually find the script in /usr/share/webmin/.
/usr/share/webmin/changepass.pl /etc/webmin admin your_new_secure_password
Make sure to substitute your_new_secure_password with your desired strong password.
For FreeBSD Systems
On FreeBSD, the path to the changepass.pl script is generally /usr/local/lib/webmin/.
/usr/local/lib/webmin/changepass.pl /usr/local/etc/webmin admin your_new_secure_password
Ensure you replace your_new_secure_password with a robust and unique password.
Accessing the Server as Root or Superuser
To run the password reset command, you need administrative privileges on your server. This usually means logging in as the root user or using sudo to gain superuser access.
To switch to the root user:
su -
To run commands as a superuser using sudo (if your user has sudo privileges):
sudo su -
Once you have root access, you can proceed with the changepass.pl command appropriate for your distribution.
Security Considerations After Password Reset
When you reset your Webmin password, it’s a critical security action. After gaining access, consider the following best practices:
- Strong Passwords: Always use complex, unique passwords that combine uppercase and lowercase letters, numbers, and symbols. Avoid easily guessable passwords.
- Regular Updates: Keep your Webmin installation and underlying operating system up-to-date to patch any known security vulnerabilities.
- Firewall Protection: Configure your server’s firewall (e.g.,
iptables,ufw,pf) to restrict access to the Webmin port (default 10000) to trusted IP addresses only. - Two-Factor Authentication (2FA): If available for your Webmin setup, enable 2FA for an additional layer of security.
- Audit Logs: Regularly review Webmin and system authentication logs for any suspicious activity. For more information on Linux security, see Linux Kernel Labs – Security.
For further reading on securing your Linux systems, consider these articles:
- Securing SSH Connection
- Linux passwd command
- How to Reset MySQL Root Password
- Set or Reset Root Password and Enable Root Login in Ubuntu
Conclusion
Resetting your Webmin password is a straightforward process when you have command-line access to your server. By following the steps outlined in this guide, you can quickly regain control of your Webmin interface. Always prioritize strong password practices and implement additional security measures to protect your server management tools. For general Linux news and updates, you can check out The Linux Foundation. Also, explore more about cybersecurity at CISA Cybersecurity.
Hello
A ‘friend’ set up a hard drive for me using webmin windows shares in 2009. I have the http address but not the username or password for login to be able to access my files. What can I do?? thanks cp.
This works for me after restarting the webmin service
Thank you, it’s working well
Thank you for feedback.
I thought I lost my password for webmin, so I wanted to reset it following this. I needed to follow the Debian version (Ubuntu 22.04), but instead of admin use root. I changed it but noticed that it chopped off a certain amount of characters and instead added mysql to the end!
When I used that, I was able to get back in. Any idea why it does that?