How To Install ocserv on CentOS 8

ocserv is OpenConnect SSL VPN server

Introduction

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

What is ocserv

OpenConnect server (ocserv) is an SSL VPN server. Its purpose is to be a secure, small, fast and configurable VPN server. It implements the OpenConnect SSL VPN protocol, and has also (currently experimental) compatibility with clients using the AnyConnect SSL VPN protocol. The OpenConnect VPN protocol uses the standard IETF security protocols such as TLS 1.2, and Datagram TLS to provide the secure VPN service.

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

Install ocserv 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 ocserv using dnf by running the following command:

sudo dnf -y install ocserv

Install ocserv 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 ocserv using yum by running the following command:

sudo yum -y install ocserv

How To Uninstall ocserv on CentOS 8

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

sudo dnf remove ocserv

ocserv Package Contents on CentOS 8

/etc/ocserv
/etc/ocserv/ocserv.conf
/etc/pam.d/ocserv
/usr/bin/occtl
/usr/bin/ocpasswd
/usr/bin/ocserv-fw
/usr/bin/ocserv-script
/usr/lib/.build-id
/usr/lib/.build-id/3a
/usr/lib/.build-id/3a/05a7ea8605c196bbb3eb16a625f263964a6a88
/usr/lib/.build-id/77
/usr/lib/.build-id/77/8c3f739908b9c1b1f903fde66f9ed44de4201e
/usr/lib/.build-id/88
/usr/lib/.build-id/88/08c279ab706c609417f8a57f657a2f2f60c12d
/usr/lib/.build-id/bb
/usr/lib/.build-id/bb/bfbb010005a7f7d6fce59af59b73c78642d5bd
/usr/lib/systemd/system/ocserv.service
/usr/sbin/ocserv
/usr/sbin/ocserv-genkey
/usr/sbin/ocserv-worker
/usr/share/doc/ocserv
/usr/share/doc/ocserv/AUTHORS
/usr/share/doc/ocserv/BSD-MIT
/usr/share/doc/ocserv/CC0
/usr/share/doc/ocserv/COPYING
/usr/share/doc/ocserv/ChangeLog
/usr/share/doc/ocserv/LGPL-2.1
/usr/share/doc/ocserv/LICENSE
/usr/share/doc/ocserv/NEWS
/usr/share/doc/ocserv/PACKAGE-LICENSING
/usr/share/doc/ocserv/README.md
/usr/share/man/man8/occtl.8.gz
/usr/share/man/man8/ocpasswd.8.gz
/usr/share/man/man8/ocserv.8.gz
/var/lib/ocserv
/var/lib/ocserv/profile.xml

References

Summary

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