Stunnel/Troubleshooting
From charlesreid1
Having issues getting stunnel client and server to connect.
Have been following this Digital Ocean guide: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-ssl-tunnel-using-stunnel-on-ubuntu
Problem Description
Currently trying to create an stunnel connection from client to server.
Here is the client stunnel.conf (Mac):
output = /var/log/stunnel4/stunnel.log cert = /usr/local/etc/stunnel/stunnel.fullchain.pem key = /usr/local/etc/stunnel/stunnel.key.pem client = yes debug = 7 [ssh] accept = 127.0.0.1:22 connect = 92.126.102.36:8000
Here is the server stunnel.conf (Ubuntu):
output = /var/log/stunnel4/stunnel.log cert = /etc/stunnel/stunnel.fullchain.pem key = /etc/stunnel/stunnel.key.pem client = no debug = 7 [ssh] accept = 8000 connect = 127.0.0.1:22
The debug level of 7 is maximum and gives a more detailed description of what's happening in the log file.
Server behavior
On the server, starting the stunnel client using the following steps:
Check the stunnel conf:
$ cat /etc/stunnel/stunnel.conf
Open port 8000 if needed:
$ iptables -A INPUT -p tcp --dport 8000 -j ACCEPT
Stop previous stunnel instances and start a new one:
$ killall stunnel && stunnel
Look at the last few lines of the log to verify it is running correctly and bound to port 8000:
$ tail /var/log/stunnel4/stunnel.log ... 2017.03.29 04:59:15 LOG5[ui]: Configuration successful 2017.03.29 04:59:15 LOG7[ui]: Listening file descriptor created (FD=7) 2017.03.29 04:59:15 LOG7[ui]: Service [ssh] (FD=7) bound to 0.0.0.0:8000
Client behavior
When the stunnel command is run on the client,