How to deny and redirect ssh port on CSF in Linux Mint 20

To deny and redirect SSH port on CSF in Linux Mint 20

Introduction:

CNF is the Config Server Firewall, a free and high-level firewall for most of the Linux distributions and Linux based VPS. Besides, the basic functionality of a firewall – filtering packets – CSF includes other security features, such as login/intrusion/flood detections. This tutorial will cover to deny and redirect SSH port on CSF in Linux Mint 20.

Installation Procedure:

Check the version of the Linux Mint 20.

root@LinuxHelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 20
Release:	20
Codename:	ulyana

Configure the SSH port on ssh configuration file

root@LinuxHelp:/usr/src/csf# vim /etc/ssh/sshd_config

Once the configuration is finished then restart the ssh service

root@LinuxHelp:/usr/src/csf# systemctl restart ssh

Now redirect the ssh port on csf to redirect file location

root@LinuxHelp:/usr/src/csf# vim /etc/csf/csf.redirect

Now add the ssh port to csf configuration file

root@LinuxHelp:/usr/src/csf# vim /etc/csf/csf.conf

Once the configuration is completed then restart the csf service

root@LinuxHelp:/usr/src/csf# csf -r
Flushing chain `INPUT'
Flushing chain `FORWARD'
Flushing chain `OUTPUT'
Flushing chain `ALLOWIN'
Flushing chain `ALLOWOUT'
Flushing chain `DENYIN'
.
.
.
*WARNING* Binary location for [SENDMAIL] [/usr/sbin/sendmail] in /etc/csf/csf.conf is either incorrect, is not installed or is not executable
*WARNING* Missing or incorrect binary locations will break csf and lfd functionality
*WARNING* RESTRICT_SYSLOG is disabled. See SECURITY WARNING in /etc/csf/csf.conf.

Once the service is restart then open ssh console and take ssh on the Linux machine. Now take the ssh on Linux Mint machine using redirect port the csf is allowed the port Here I am trying take ssh on my Linux Mint machine using ssh port the csf redirect the ssh port With this method, to deny and redirect the SSH port on CSF in Linux Mint 20 comes to an end.

FAQ
Q
From where do you redirect the ssh port on csf?
A
The location is /etc/csf/csf.redirect
Q
From where do you add the ssh port on csf?
A
The location is /etc/csf/csf.conf
Q
From where do you change the ssh port?
A
The location is /etc/ssh/sshd_config
Q
What is mean by SSH?
A
The SSH protocol (also referred to as Secure Shell) is a method for secure remote login from one computer to another. It provides several alternative options for strong authentication, and it protects the communications security and integrity with strong encryption.
Q
What is CSF(Config Server Firewall)?
A
CNF is the Config Server Firewall, a free and high-level firewall for most of the Linux distributions and Linux based VPS. Besides, the basic functionality of a firewall – filtering packets – CSF includes other security features, such as login/intrusion/flood detections.