How To Install sslh on CentOS 8

sslh is Applicative protocol(SSL/SSH) multiplexer

Introduction

In this tutorial we learn how to install sslh on CentOS 8.

What is sslh

sslh accepts connections on specified ports, and forwards them further based on tests performed on the first data packet sent by the remote client. Probes for HTTP, SSL, SSH, OpenVPN, tinc, XMPP are implemented, and any other protocol that can be tested using a regular expression, can be recognized. A typical use case is to allow serving several services on port 443 (e.g. to connect to ssh from inside a corporate firewall, which almost never block port 443) while still serving HTTPS on that port. Hence sslh acts as a protocol multiplexer, or a switchboard. Its name comes from its original function to serve SSH and HTTPS on the same port.

We can use yum or dnf to install sslh on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install sslh.

Install sslh on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install sslh using dnf by running the following command:

sudo dnf -y install sslh

Install sslh on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install sslh using yum by running the following command:

sudo yum -y install sslh

How To Uninstall sslh on CentOS 8

To uninstall only the sslh package we can use the following command:

sudo dnf remove sslh

sslh Package Contents on CentOS 8

/etc/sslh.cfg
/etc/sysconfig/sslh
/usr/lib/.build-id
/usr/lib/.build-id/68
/usr/lib/.build-id/68/724870d4b90e0be0fdbc45957c9b75ec6cf830
/usr/lib/.build-id/eb
/usr/lib/.build-id/eb/597a353f365e6054247f3579a01920a80c695e
/usr/lib/systemd/system/sslh.service
/usr/lib/systemd/system/sslh.socket
/usr/sbin/sslh
/usr/sbin/sslh-select
/usr/share/doc/sslh
/usr/share/doc/sslh/ChangeLog
/usr/share/doc/sslh/README.md
/usr/share/doc/sslh/example.cfg
/usr/share/licenses/sslh
/usr/share/licenses/sslh/COPYING
/usr/share/man/man8/sslh.8.gz

References

Summary

In this tutorial we learn how to install sslh on CentOS 8 using yum and dnf.