Runtime Control script for Red Hat | CentOS | Fedora::

stunnel Logo


I am pleased to be able to offer a Red Hat / Fedora Linux based runtime-control script for running stunnel. The script is free to download and modify for your own system needs.

1: Do I have stunnel?

From a 'root' user prompt (or super-user) enter the command rpm -q stunnel. If you do not have stunnel installed, you can install it via the Yum: yum install stunnel.

2: Download Runtime script

The script is available via the link below. After downloading the file, remember to gzip -d stunnel.gz to decompress the file. A text version of the script is also available for reference, printing, etc.

3: Install Runtime script

Copy the expanded file into your /etc/init.d/ directory; check the permissions are 755 (chmod 755 stunnel); and the user:group rights are both set to 'root' (chown root:root stunnel); then run the following command:

/sbin/chkconfig --add stunnel

The 'chkconfig' program creates the symlinks in the rc0.d, rc1.d,... rc6.d directories.

4: stunnel.conf

The RC script expects the stunnel configuration file to live in /etc/stunnel. If the directory does not exist, you must create it (mkdir /etc/stunnel).

The stunnel.conf example below can be used to provide secure tunnelling for Rsync. All Rsync traffic into the server is encrypted and routes via port 273. See the stunnel website for more information regarding secure tunnelling of services.

# Configuration file for stunnel server.
# Gaztronics
# Last updated: 4th March 2005

# Path to certificate file.
cert = /usr/share/ssl/certs/stunnel.pem

# Path to Certificate Authority file.
CAfile = /usr/share/ssl/certs/CA.crt

# Are we client or server?
# Set to "no" for Server mode.
client = no

# Services for secure tunnelling:
accept = 273
connect = 873

5. Running

You may now enter the following commands to control stunnel:

service stunnel start
service stunnel stop
service stunnel status
service stunnel restart
service stunnel condrestart

External Links


See here for a useful guide to using Rsync with stunnel.

Page updated: 10th May 2017