

- #Stunnel iptables how to#
- #Stunnel iptables install#
- #Stunnel iptables update#
- #Stunnel iptables android#
#Stunnel iptables how to#
How To Use SFTP to Securely Transfer Files with a Remote Server There’s also a good tutorial on SFTP here: Using a SFTP client such as Filezilla, connect to your server and download the “stunnel.pem” file located in “/etc/stunnel/” directory to the client. There are many ways of obtaining the “stunnel.pem” file from server, but we’re going to use SFTP which is both easy and very secure. In order for Stunnel to communicate with the server, the SSL certificate we created in Step 5 must be present at the client. The only difference would be placement of “nf” file required for configuration of Stunnel.
#Stunnel iptables android#
Note: This explains the process of installing and configuration of Stunnel as a client in Windows, but Stunnel could also be installed in Linux and even Android and configuration still remains the same.
#Stunnel iptables install#
Install Squid using the command below: apt-get install squid3 -y Note: When creating the certificate, you will be asked for some information such as country and state, which you can enter whatever you like but when asked for “Common Name” you must enter the correct host name or IP address of your droplet (VPS).Īlso, enable Stunnel automatic startup by configuring the “/etc/default/stunnel4” file, enter command below to open the file in text editor: nano /etc/default/stunnel4įinally, restart Stunnel for configuration to take effect, using this command: /etc/init.d/stunnel4 restart Openssl req -new -x509 -key key.pem -out cert.pem -days 1095Ĭat key.pem cert.pem > /etc/stunnel/stunnel.pemīasically, the commands above is for creating a private key, creating a certificate using that key and combining the two of them into one files named “stunnel.pem” to use with Stunnel. Stunnel uses SSL certificate to secure its connections, which you can easily create using the OpenSSL package: openssl genrsa -out key.pem 2048 Note: The client = no part isn’t necessary, Stunnel by default is set to server mode. So overall the “nf” file must contain the lines below: client = no Squid proxy by default runs on localhost and port 3128 so we have to tell Stunnel to forward accepted connections to that port: Then depending on the service you’re going to use the secure tunnel on, you must specify the port and IP address of that in the configuration file Basically Stunnel takes packets from a secure port and then forwards it to the port and IP address of the service you specified. This can be any of the 65535 ports, as long as it’s not blocked by another service or firewall: We’ll explain how to install and configure Squid in Step 6.Īfter setting a name for the service you’re going to use, you must tell Stunnel to listen on which port for that service. Here as an example we’re going to secure traffics between Squid proxy server and a client using Stunnel. It can be any of the services which use networking such as mail server, proxy server, etc. Next we specify a service for use with Stunnel. We’re going to be using a SSL certificate to identify ourselves to the server so we have to set the path to that certificate in “nf” file using this line (We will create the certificate file in the next step): cert = /etc/stunnel/stunnel.pem Stunnel configures itself using a file named “nf” which by default is located in “/etc/stunnel”.Ĭreate a “nf” file in the “/etc/stunnel” directory: nano /etc/stunnel/nf

Install Stunnel package using the code below: apt-get install stunnel4 -y
#Stunnel iptables update#
Using these commands update your Ubuntu’s package list and also upgrade the existing packages to the latest version: apt-get update It’s somehow like a small secure VPN that runs on specific ports. What Stunnel basically does is that it turns any insecure TCP port into a secure encrypted port using OpenSSL package for cryptography. It can be used to add SSL functionality to commonly used inetd daemons like POP2, POP3, and IMAP servers without any changes in the program’s code. The Stunnel program is designed to work as an SSL encryption wrapper between remote client and local (inetd-startable) or remote server.
