miligurus.blogg.se

Stunnel iptables
Stunnel iptables











stunnel iptables
  1. #Stunnel iptables how to#
  2. #Stunnel iptables install#
  3. #Stunnel iptables update#
  4. #Stunnel iptables code#

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:

#Stunnel iptables how to#

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

#Stunnel iptables code#

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. How to migrate server data to a supported version.How to upgrade from Ubuntu 14.04 to Ubuntu 16.04.How to upgrade from Ubuntu 12.04 to Ubuntu 14.04.If you are currently operating a server running Ubuntu 12.04, we highly recommend upgrading or migrating to a supported version of Ubuntu: How To Encrypt Traffic to Redis with Stunnel on Ubuntu 16.04.We strongly recommend using a recent article written for the version of Ubuntu you are using. This article may still be useful as a reference, but may not follow best practices or work on this or other Ubuntu releases. Ubuntu 12.04 reached end of life (EOL) on Apand no longer receives security patches or updates. This article is deprecated and no longer maintained.













Stunnel iptables