LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-26-2006, 07:16 PM   #1
hassan2
LQ Newbie
 
Registered: Oct 2004
Location: London, England
Posts: 23

Rep: Reputation: 15
stunnel will not start


I am tring to start stunnel version 4.05 that come standard with Suse Enterprise 9 CD.

I intend to start stunnel as a daemon, I have generate and self signed the certificate using openssl with openssl version 0.9.7d but stunnel will not start up instead I received the following error message

Starting stunnel (SSL tunnel) please see /var/log/rc.stunnel.log failed

in my log fail file;

stunnel[29384]: SSL_accept: Peer suddenly disconnected
 
Old 01-26-2006, 07:43 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617
Config error? Endpoint down? Firewall? Any more details? Post server/client config maybe?
 
Old 01-27-2006, 03:24 PM   #3
hassan2
LQ Newbie
 
Registered: Oct 2004
Location: London, England
Posts: 23

Original Poster
Rep: Reputation: 15
Here is my stunnel.conf

# Sample stunnel configuration file
# Copyright by Michal Trojnara 2002
# --with changes for SuSE package

# client = yes | no
# client mode (remote service uses SSL)
# default: no (server mode)
client = no

#
# chroot + user (comment out to disable)
#
chroot = /var/lib/stunnel/
setuid = stunnel
setgid = nogroup
# note about the chroot feature and the "exec" keyword to start other services..
.
# while the init script /etc/init.d/stunnel will copy the binaries and libraries

# into the chroot jail, more files might be needed in the jail (configuration
# files etc.)

pid = /var/run/stunnel.pid

#
# debugging
#
#debug = 7
#output = stunnel.log

# Workaround for Eudora bug
#options = DONT_INSERT_EMPTY_FRAGMENTS

#
# Authentication stuff
#
#verify = 2
# don't forget about c_rehash CApath
# it is located inside chroot jail:
#CApath = /certs
# or simply use CAfile instead:
#CAfile = /etc/stunnel/certs.pem

cert = /etc/stunnel/stunnel.pem

#
# Examples for service-level configuration:
#

# [pop3s]
# accept = 995
# connect = 110

# [imaps]
# accept = 993
# connect = 143

# [imaps]
# accept = 993
# exec = /usr/sbin/imapd
# execargs = imapd
# pty = no

# [ssmtp]
# accept = 465
# connect = 25

[s1]
# accept = 5000
# connect = mail.example.com:110
# delay = yes

# [s2]
# accept = 5001
# connect = mail.example.com:25

# [https]
# accept = 443
# connect = 80
# TIMEOUTclose = 0

# [swat]
# accept = 902
# connect = 901

#
# mysql over stunnel example:
#
# [mysqls] <-- on the server
# accept = 3307
# connect = localhost:mysql
# client = yes <-- on the client
# [mysqls]
# accept = 3307
# connect = remote-mysql-server.example.com:3307
#
# Hint. Use the mysql client with "-h 127.0.0.1", not "-h localhost", because
# "localhost" will mean it will go through the local socket and ignore the port.

#
# pppd over stunnel example:
# (note: read http://sites.inka.de/sites/bigred/devel/tcp-tcp.html , and
# look for better alternatives like cipe or openvpn.)
#
# [ppp] <-- on the server
# accept = 2020
# exec = /usr/sbin/pppd
# execargs = pppd local
# # the pty option doesn't work in chroot jail without further efforts
# #pty = yes
#
#
# [ppp] <-- on the "client"
#
# pppd over stunnel example:
# (note: read http://sites.inka.de/sites/bigred/devel/tcp-tcp.html , and
# look for better alternatives like cipe or openvpn.)
#
# [ppp] <-- on the server
# accept = 2020
# exec = /usr/sbin/pppd
# execargs = pppd local
# # the pty option doesn't work in chroot jail without further efforts
# #pty = yes
#
#
# [ppp] <-- on the "client"
# connect = host.example.com:2020
# exec = /usr/sbin/pppd
# execargs = pppd local nodeflate nobsdcomp 192.168.20.20:192.168.20.21
# # the pty option doesn't work in chroot jail without further efforts
# #pty = yes

can you help? please
 
Old 01-29-2006, 06:45 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617
Next time please leave out the commented stuff, makes it easier to read: "grep -v ^# stunnel.conf". What you then get is this:
client = no
chroot = /var/lib/stunnel/
setuid = stunnel
setgid = nogroup
pid = /var/run/stunnel.pid
cert = /etc/stunnel/stunnel.pem

[s1]

So you have the service name set, but no options. Check your man page for examples and add one to test with.
Since you're testing/troubleshooting you want to capture all information, add: "debug=7" and "output=/some/dir/stunnel.debug".
 
Old 01-30-2006, 06:30 PM   #5
hassan2
LQ Newbie
 
Registered: Oct 2004
Location: London, England
Posts: 23

Original Poster
Rep: Reputation: 15
i install stunnel version 3.14 on my suse enterprise linux 8 and I use the to tunnel smpt from port 25 to port 465 this worked fine I use this command stunnel -c -r cyrus.bbc.co.uk:465

I upgraded my machine to suse enterprise linux 9 and install stunnet 4.05 and when I try to run this same command stunnel -c -r cyrus.bbc.co.uk:465 I get the following error stunnel [filename] | -fd [n] | -help | -version | -sockets

Here is my configuration file
client = no

chroot = /var/lib/stunnel/
setuid = stunnel
setgid = nogroup

pid = /var/run/stunnel.pid

debug = 7
output = stunnel.log

cert = /etc/stunnel/stunnel.pem
[ssmtp]
accept = 25
connect = cyrus.bbc.co.uk:465

when I run this command stunnel /etc/stunnel/stunnel.conf
I don't any get error nor do I get smtps connection either

Can you help please? I do I run stunnel, to tunnel smtp from(port 25) to smtps(port 465) can you help please



Thanks
 
Old 01-31-2006, 03:46 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617
when I try to run this same command stunnel -c -r cyrus.bbc.co.uk:465 I get the following error stunnel [filename] | -fd [n] | -help | -version | -sockets
As far as I know Stunnel 4.x does not allow a commandline setup like that anymore but requires a config file instead.


when I run this command stunnel /etc/stunnel/stunnel.conf I don't any get error nor do I get smtps connection either
And what does stunnel.log say? When debugging that should be the first place to look. You'll probably gonna see one or more of the following: UID/GID errors if user "stunnel" or group "nogroup" doesn't exist, unable to write pid (you set chroot), unable to find cert (you set chroot), something like "unable to access service" if you're not "cyrus.bbc.co.uk" and you want to forward yourip:25 to yourip:465 use your own hostname/ip address. If you however *really* want to forward yourip:25 to cyrus.bbc.co.uk:465 then you're fscked: the host doesn't exist as a publicly accessable server as far as I know...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stunnel over WiFi... need help linuxgeekery Linux - Wireless Networking 1 08-08-2005 03:03 PM
stunnel and netcat?? scoobydude Linux - Networking 0 05-25-2005 01:43 AM
VNC and stunnel lacerto Linux - Security 2 04-28-2005 07:27 AM
Need Help: new to stunnel Traveler_Q Linux - Security 1 04-21-2004 08:49 PM
Stunnel won't work! Linux6574 Linux - General 0 04-12-2004 04:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration