Creating a stunnel connection on Ubuntu – server side

For this, use an Ubuntu 18.04 VM:

  1. Install stunnel:
sudo apt install stunnel
  1. In the /etc/stunnel directory, create the stunnel.conf file with the following contents:
cert=/etc/stunnel/stunnel.pem
fips=no

[hear from client]
accept=30000
connect=6514
  1. While still in the /etc/stunnel directory, create the stunnel.pem certificate:
sudo openssl req -new -x509 -days 3650 -nodes -out stunnel.pem -keyout stunnel.pem
  1. Start the stunnel daemon:
sudo /etc/init.d/stunnel4 start
  1. To make it automatically start when you reboot the system, edit the /etc/default/stunnel4 file. Look for this line:
ENABLED=0

Change it to this:

ENABLED=1
  1. In the /etc/rsyslog.conf file, look for this line at the top:
input(type="imtcp" port="514")

Change it to this:

input(type="imtcp" port="6514")
  1. After saving the file, restart the rsyslog daemon:
sudo systemctl restart rsyslog
  1. Using the appropriate iptables, ufw, or nftables command, open port 30000/tcp on the firewall, and close port 514.
  2. This is the end of the lab.

Next, we'll configure the client.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.9.115