Setting up the client side of the stunnel tunnel is very easy. The hardest part again is understanding what to put in the Accept and Connect parameters. Again, I will assume that the stunnel package has already been installed on the Raspberry Pi.
- Copy the stunnel.pem file from the C&C server over to the Raspberry Pi.
- Edit the stunnel.conf file to reflect the accept and connect IP/Port information as well as letting stunnel know this is a client. This file should be located in /etc/stunnel/stunnel.conf. You want to make sure that you set the client to yes since the Pi will act as a client. The accept will be the localhost port you will connect to bring up the tunnel; in this case, this is the ssh ...