Modify the Default Webmin’s Port Number on CentOS 6.6

Bismillahirrahmanirrahim..

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 search for port and listen. Then change the value to 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

Make sure your firewall is open for port 10101. In Centos 7 please use below cmd

firewall-cmd --permanent --zone=public --add-port=10000/tcp

Now you can access the Webmin through url with new custom port.

https://serverip:10101

wassalam..

Advertisements
This entry was posted in Linux and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s