Runtime Control script for Red Hat / Fedora Core::

stunnel Logo

Intro

I am pleased to be able to offer a Red Hat / Fedora Core Linux based runtime-control script for running stunnel. The script is free to download and modify for your own system needs. If you make improvements, please feel free to email the changes back to me.

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, either from the RPM on the DVD/CD (e.g. rpm -i /media/cdrom/Fedora/RPMS/stunnel-4.05-3.i386.rpm), or if you use YUM, via the following command: yum install stunnel.

2: Download Runtime script

The script is available in gzip format from my FTP server. 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 (md /etc/stunnel).

The stunnel.conf example below is from the Gaztronics server and is 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:
#
[rsync]
accept = 273
connect = 873

5. Running

You may now enter the following commands to control stunnel:

/etc/init.d/stunnel start
/etc/init.d/stunnel stop
/etc/init.d/stunnel status
/etc/init.d/stunnel restart
/etc/init.d/stunnel condrestart

External Links

stunnel

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

Best viewed
with:
Mozilla | Opera