How to Modify the Default Webmin’s Port Number on CentOS 5.7

To improve the security on my linux centOS server, it is recommended to change the default port of the service and change it to custom webmin’s port number. In this post i will show you on how to modify the default port, 10000 to 10101.

Check default port number :

[root@CentOS57 ~]# netstat -plunt | grep perl
tcp        0      0 0.0.0.0:10000               0.0.0.0:*                   LISTEN      4521/perl   
udp        0      0 0.0.0.0:10000               0.0.0.0:*                               4521/perl  

Where is the webmin port number stored?
Webmin port number store in /etc/webmin/miniserv.conf

To modify the default port, 10000 to 10101, open the /etc/webmin/miniserv.conf file and modify line 1 and 16.

1 port=10101
..
..
16 listen=10101
..

Sample configuration file :

[root@CentOS57 ~]# vi /etc/webmin/miniserv.conf
port=10101
root=/usr/local/webmin
mimetypes=/usr/local/webmin/mime.types
addtype_cgi=internal/cgi
realm=Webmin Server
logfile=/var/webmin/miniserv.log
errorlog=/var/webmin/miniserv.error
pidfile=/var/webmin/miniserv.pid
logtime=168
ppath=
ssl=0
env_WEBMIN_CONFIG=/etc/webmin
env_WEBMIN_VAR=/var/webmin
atboot=1
logout=/etc/webmin/logout-flag
listen=10101
denyfile=\.pl$
log=1
blockhost_failures=5
blockhost_time=60
syslog=1
session=1
premodules=WebminCore
server=MiniServ/1.570
userfile=/etc/webmin/miniserv.users
keyfile=/etc/webmin/miniserv.pem
passwd_file=/etc/shadow
passwd_uindex=0
passwd_pindex=1
passwd_cindex=2
passwd_mindex=4
passwd_mode=0
preroot=blue-theme
passdelay=1

Restart webmin service using this command:

[root@CentOS57 ~]# /etc/webmin/restart
Stopping Webmin server in /usr/local/webmin
Starting Webmin server in /usr/local/webmin
Pre-loaded WebminCore

Check the modified webmin’s port number

[root@CentOS57 ~]# netstat -plunt | grep perl
tcp        0      0 0.0.0.0:10101               0.0.0.0:*                   LISTEN      4750/perl   
udp        0      0 0.0.0.0:10101               0.0.0.0:*                               4750/perl

Now you can access the Webmin through url with new custom port.
http://serverip:10101

1 comment
  1. Jonathan Service
    Jonathan Service
    April 1, 2020 at 5:45 am

    Thank you so much!!! I was locked out of webmin as port 10000 was being used by another webmin process, after following your tips i was able to change the port to allow me in after 24 hours of searching for a resolve. you’re a star.

    Reply
Leave a Reply

Your email address will not be published. Required fields are marked *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee