Tuesday, August 21, 2018

The correct way to install Webmin on CentOS

Webmin is a useful tool administer servers. This is especially if you are managing quite a few servers. However, most users just install the RPM or packages and don't keep them updated. This has lead to webmin being a target for hackers to find vulnerabilities for them to exploit. Since Webmin manages the server itself, breaking into webmin means taking control over the server.
The correct way is to configure a repository for Webmin. This way, every time webmin is updated by the developers, the normal update process will update webmin also.
First, create a repository file for webmin.Create a file called webmin.repo in the /etc/yum.repos.d/ directory.
The file should contain the following lines.

[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1

Save the file and then execute

# yum check-update 

This will update the repository database. Now get the key. These commands gets the key and imports them for use.

# wget http://www.webmin.com/jcameron-key.asc
# rpm --import jcameron-key.asc


The command below will install webmin and it's dependencies based on the webmin repository and other repos configured in your server.
 
# yum install webmin

The next time you update the system, webmin will be checked and updated also.