Install and Secure Webmin on Debian
Webmin is a web based tool to help manage your Linux system.
Let’s get started by downloading the official installer script.
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4876 100 4876 0 0 95607 0 --:--:-- --:--:-- --:--:-- 95607
Execute the script.
sudo sh setup-repos.sh Setup Webmin official repository? (y/N) y Downloading Webmin key .. .. done Installing Webmin key .. .. done Setting up Webmin repository .. .. done Cleaning repository metadata .. .. done Downloading repository metadata .. .. done Webmin package can now be installed using apt-get install webmin command.
Let’s install Webmin now.
sudo apt -y install webmin
Once installed, we will need change the default port number and then allow this through the firewall (if you have one). To begin, edit Webmin config file miniserv.conf.
sudo nano /etc/webmin/miniserv.conf
Change the port value to a different number. Valid port numbers range from 1-65535, remember the first 1024 are considered reserved.
port=11223
Save and exit the file.
If you have a firewall, allow this port access. I will also only allow local access to Webmin. I use UFW so here is the command for that. Of course, replace 11223 with the port you picked. Since I’m only allowing local access, then changing the port is just obfuscation.
ufw allow from 192.168.2.0/24 to any port 11223 proto tcp comment 'Allow Webmin'
Starting your browser, enter your IP address of your machine, colon, and finally the port number. For example 192.168.2.55:11223. You should see this prompt asking for your username and password.
The default username is root and the password is the same as what you used to sign into Linux as root.
Once you click Sign in, you should see the dashboard and it’s ready for your modification. But before you start let’s get rid of the root user and create your own user.
On Webmin’s Dashboard, click Webmin, then Webmin Users.
Then click Create a new Privileged user.
Fill in the Username, set the password.
Click to open Available Webmin modules.
Select the check box Select all.
This will select all modules, giving your user the same access as root. Next logout of Webmin and login as your new user. Checking you have access to all modules.
To delete the root user, go back to Webmin Users. Select the root user and click Delete Selected.
That is all for today, hope this was of some help to you. Good Luck!
Share this content:
Leave a Reply