GNU/Linux >> Linux Esercitazione >  >> Debian

Come installare OpenVPN su Debian 9 Stretch

In questo tutorial, ti mostreremo come installare OpenVPN su Debian 9 Stretch. Per chi non lo sapesse, OpenVPN è un'applicazione open source ampiamente utilizzata per creare reti private virtuali sicure su Internet pubblico non protetto. OpenVPN è una soluzione SSL VPN che drena la connessione del tuo sistema in modo sicuro attraverso Internet. OpenVPN funziona nella struttura client-server. Tutti i dispositivi connessi a una rete privata virtuale si comportano come se ricollegato alla tua rete locale.I pacchetti inviati attraverso il tunnel VPN sono crittografati con crittografia AES a 256 bit, rendendo impossibile il furto di dati.

Questo articolo presuppone che tu abbia almeno una conoscenza di base di Linux, sappia come usare la shell e, soprattutto, che ospiti il ​​tuo sito sul tuo VPS. L'installazione è abbastanza semplice e presuppone che tu sono in esecuzione nell'account root, in caso contrario potrebbe essere necessario aggiungere 'sudo ' ai comandi per ottenere i privilegi di root. Ti mostrerò passo dopo passo l'installazione di OpenVPN su un server Debian 9 (Stretch).

Installa OpenVPN su Debian 9 Stretch

Passaggio 1. Prima di installare qualsiasi software, è importante assicurarsi che il sistema sia aggiornato eseguendo il seguente apt-get comandi nel terminale:

apt-get update
apt-get upgrade

Passaggio 2. Installazione di OpenVPN su Debian 9.

Nota :Useremo l'indirizzo IP in questo tutorial. Ad esempio, il tuo IP pubblico è:216.58.197.67

Per prima cosa, scarica il programma di installazione di OpenVPN road warrior per Debian:

wget https://git.io/vpn -O openvpn-install.sh

Una volta scaricato, esegui lo script OpenVPN-install.sh per installare e configurare il server OpenVPN:

bash openvpn-install.sh

Ti verrà chiesto di inserire il tuo indirizzo IP, porta, ecc. Assicurati di modificare l'indirizzo IP con il tuo indirizzo IP pubblico:

Welcome to this quick OpenVPN "road warrior" installer

I need to ask you a few questions before starting the setup
You can leave the default options and just press enter if you are ok with them

First I need to know the IPv4 address of the network interface you want OpenVPN
listening to.
IP address: 216.58.197.67

Which protocol do you want for OpenVPN connections?
 1) UDP (recommended)
 2) TCP
Protocol [1-2]: 1

What port do you want OpenVPN listening to?
Port: 1194

Which DNS do you want to use with the VPN?
 1) Current system resolvers
 2) Google
 3) OpenDNS
 4) NTT
 5) Hurricane Electric
 6) Verisign
DNS [1-6]: 2

Finally, tell me your name for the client certificate
Please, use one word only, no special characters
Client name: idroot-openvpn

Okay, that was all I needed. We are ready to setup your OpenVPN server now
Press any key to continue...

A questo punto, il nostro server OpenVPN è pronto. Ora puoi controllare la regola del firewall:

cat /etc/rc.local

Output di esempio:

#!/bin/sh -e
iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT
iptables -I INPUT -p udp --dport 1194 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to 139.59.105.37
exit 0

Ora, abilita e avvia il servizio OpenVPN:

## start service ##
systemctl start openvpn@server

## stop service ##
systemctl stop openvpn@server

## check status ##
systemctl status openvpn@server

Ora possiamo scaricare il file di configurazione ovpn. Questo file verrà utilizzato per connetterci al server. Possiamo usare il comando SCP per farlo:

scp [email protected]:~/idroot-openvpn.ovpn /home/godet/Desktop

Congratulazioni! Hai installato con successo OpenVPN. Grazie per aver utilizzato questo tutorial per l'installazione di OpenVPN sul server Debian 9 Stretch. Per ulteriore aiuto o informazioni utili, ti consigliamo di controllare il sito Web ufficiale di OpenVPN.


Debian
  1. Come installare VirtualBox 5.1 su Debian 9 (Stretch)

  2. Come installare Docker su Debian 9 Stretch

  3. Come installare Skype su Debian 9 Stretch

  4. Come installare Pip su Debian 9 Stretch

  5. Come installare Composer su Debian 9 Stretch

Come installare Steam su Debian 9 Stretch

Come installare Wine su Debian 9 Stretch

Come installare Python 3.7 su Debian 9 Stretch

Come installare Kodi su Debian 9 Stretch

Come installare Gradle su Debian 9 Stretch

Come installare Vai su Debian 9 Stretch