Skip to content

Instantly share code, notes, and snippets.

@linuxoracledev
Last active January 2, 2020 20:43
Show Gist options
  • Save linuxoracledev/08cfe0dc21434047ac5b38b2a089ac02 to your computer and use it in GitHub Desktop.
Save linuxoracledev/08cfe0dc21434047ac5b38b2a089ac02 to your computer and use it in GitHub Desktop.
How to Install Webmin on Ubuntu 18.04 & 16.04 LTS with Config Server Firewall (CSF) Installation and Configuration
#Configure APT Repository
sudo nano /etc/apt/sources.list.d/webmin.list
#Add below value to this file:
# deb http://download.webmin.com/download/repository sarge contrib
# deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
#Import the GPG key
curl http://www.webmin.com/jcameron-key.asc | sudo apt-key add -
#nstall Webmin
sudo apt-get update
sudo apt-get install webmin
#Access Webmin
#https://localhost:10000/
#How To Install and Configure Config Server Firewall (CSF) on Ubuntu
#Download ConfigServer Firewall
wget http://download.configserver.com/csf.tgz
#ncompressing
tar -xzf csf.tgz
#disable Firewall
ufw disable
#Install ConfigServer Firewall
cd csf
sudo sh install.sh
#check if the required iptables modules are available
sudo perl /usr/local/csf/bin/csftest.pl
#Basic Configuration
nano /etc/csf/csf.conf
#TESTING = "0"
#Apply changes
csf -r
#Configuring ports
################################################
#On any server:
#TCP_IN: 22,53
#TCP_OUT: 22,53,80,113,443
#UPD_IN: 53
#UPD_OUT: 53,113,123
#Apache:
#TCP_IN: 80,443
#FTP server:
#TCP_IN: 20,21
#TCP_OUT: 20,21
#UPD_IN: 20,21
#UPD_OUT:20,21
#Mail server:
#TCP_IN: 25,110,143,587,993,995
#TCP_OUT: 25,110
#MySQL server
#TCP_IN: 3306
#TCP_OUT: 3306
#Blocking IP addresses
nano /etc/csf/csf.deny
#Allowing IP addresses
nano /etc/csf/csf.allow
#Ignoring IP addresses
nano /etc/csf/csf.ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment