Runtime Control script for Red Hat | CentOS | Fedora::
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.
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.
# 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
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
See here for a useful guide to using Rsync with stunnel.
Page updated: 10th May 2017