GNU/Linux >> Tutoriales Linux >  >> Ubuntu

Cómo instalar y configurar el servidor Algo VPN en Ubuntu 20.04

Algo VPN es un paquete de software de código abierto o un conjunto de secuencias de comandos de Ansible que se utiliza para configurar una VPN IPsec y WireGuard. Fue diseñado por Trail of Bits para hacer que el proceso de instalación de VPN sea simple pero seguro. Algo VPN le permite conectarse desde cualquier dispositivo, incluidos Windows, Linux, OSX, Android e iOS. Algo VPN es compatible con muchos proveedores de servicios en la nube, incluidos Amazon, Google Cloud, Vultr, DigitalOcean, Scalway, Linode y OpenStack.

En este tutorial, le mostraremos cómo configurar un servidor VPN con Algo VPN en el servidor Ubuntu 20.04.

Requisitos

  • Un servidor con Ubuntu 20.04.
  • Se configura una contraseña de root en el servidor.

Cómo empezar

Primero, actualice los paquetes de su sistema a la última versión usando el siguiente comando:

apt-get update -y

Una vez que todos los paquetes estén actualizados, instale otras dependencias con el siguiente comando:

apt-get install git apparmor build-essential python3-dev python3-pip python3-setuptools python3-virtualenv libffi-dev libssl-dev -y

A continuación, deberá deshabilitar el servicio de resolución de nombres para que dnsmasq funcione. Puede desactivarlo con el siguiente comando:

systemctl disable systemd-resolved
systemctl stop systemd-resolved
unlink /etc/resolv.conf
echo "nameserver 8.8.8.8" > /etc/resolv.conf

Una vez que haya terminado, puede continuar con el siguiente paso.

Instalar y configurar Algo VPN

Primero, descargue la última versión de Algo VPN desde el repositorio de Git usando el siguiente comando:

git clone https://github.com/trailofbits/algo.git

A continuación, cambie el directorio al directorio descargado y cree un entorno virtual de Python con el siguiente comando:

cd algo
python3 -m virtualenv --python=/usr/bin/python3 .env

A continuación, active el entorno virtual con el siguiente comando:

source .env/bin/activate

A continuación, instale las dependencias requeridas con el siguiente comando:

python3 -m pip install -U pip virtualenv
python3 -m pip install -r requirements.txt

Una vez que todas las dependencias estén instaladas, instale Algo VPN ejecutando el siguiente comando:

./algo

Se le pedirá que elija el proveedor de la nube como se muestra a continuación:

TASK [Set required ansible version as a fact] *************************************************************************************************
ok: [localhost] => (item=ansible==2.9.7)

TASK [Verify Python meets Algo VPN requirements] **********************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [Verify Ansible meets Algo VPN requirements] *********************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}
[WARNING]: Found variable using reserved name: no_log

PLAY [Ask user for the input] *****************************************************************************************************************

TASK [Gathering Facts] ************************************************************************************************************************
ok: [localhost]
[Cloud prompt]
What provider would you like to use?
    1. DigitalOcean
    2. Amazon Lightsail
    3. Amazon EC2
    4. Microsoft Azure
    5. Google Compute Engine
    6. Hetzner Cloud
    7. Vultr
    8. Scaleway
    9. OpenStack (DreamCompute optimised)
    10. CloudStack (Exoscale optimised)
    11. Linode
    12. Install to existing Ubuntu 18.04 or 20.04 server (for more advanced users)
  
Enter the number of your desired provider
:
12

Type 12 and hit Enter to setup Algo VPN on Ubuntu 20.04 server. You will be asked for several questions as shown below:

TASK [Set facts based on the input] ***************************************************************************************************************************************************************************************
ok: [localhost]
[Cellular On Demand prompt]
Do you want macOS/iOS IPsec clients to enable "Connect On Demand" when connected to cellular networks?
[y/N]
:y

TASK [Cellular On Demand prompt] ******************************************************************************************************************************************************************************************
ok: [localhost]
[Wi-Fi On Demand prompt]
Do you want macOS/iOS IPsec clients to enable "Connect On Demand" when connected to Wi-Fi?
[y/N]
:y

TASK [Wi-Fi On Demand prompt] *********************************************************************************************************************************************************************************************
ok: [localhost]
[Trusted Wi-Fi networks prompt]
List the names of any trusted Wi-Fi networks where macOS/iOS IPsec clients should not use "Connect On Demand"
(e.g., your home network. Comma-separated value, e.g., HomeNet,OfficeWifi,AlgoWiFi)
:HomeNet

TASK [Trusted Wi-Fi networks prompt] **************************************************************************************************************************************************************************************
ok: [localhost]
[Compatible ciphers prompt]
Do you want the VPN to support Windows 10 or Linux Desktop clients? (enables compatible ciphers and key exchange, less secure)
[y/N]
:y

TASK [Compatible ciphers prompt] ******************************************************************************************************************************************************************************************
ok: [localhost]
[Retain the CA key prompt]
Do you want to retain the CA key? (required to add users in the future, but less secure)
[y/N]
:y

TASK [Retain the CA key prompt] *******************************************************************************************************************************************************************************************
ok: [localhost]
[DNS adblocking prompt]
Do you want to install an ad blocking DNS resolver on this VPN server?
[y/N]
:y

TASK [DNS adblocking prompt] **********************************************************************************************************************************************************************************************
ok: [localhost]
[SSH tunneling prompt]
Do you want each user to have their own account for SSH tunneling?
[y/N]
:N
Enter the IP address of your server: (or use localhost for local installation):
[localhost]
:
localhost
TASK [local : pause] **************************************************************************************************************************
ok: [localhost]

TASK [local : Set the facts] ******************************************************************************************************************
ok: [localhost]
[local : pause]
What user should we use to login on the server? (note: passwordless login required, or ignore if you're deploying to localhost)
[root]
:
root

Enter the public IP address or domain name of your server: (IMPORTANT! This is used to verify the certificate)
[45.58.38.120]

Una vez que la instalación se haya completado con éxito, debería obtener el siguiente resultado:

TASK [debug] **********************************************************************************************************************************
ok: [localhost] => {
    "msg": [
        [
            "\"#                          Congratulations!                            #\"",
            "\"#                     Your Algo server is running.                     #\"",
            "\"#    Config files and certificates are in the ./configs/ directory.    #\"",
            "\"#              Go to https://whoer.net/ after connecting               #\"",
            "\"#        and ensure that all your traffic passes through the VPN.      #\"",
            "\"#                     Local DNS resolver 172.18.7.104                   #\"",
            ""
        ],
        "    \"#        The p12 and SSH keys password for new users is 7OEfSUZt0       #\"\n",
        "    \"#        The CA key password is [email protected]       #\"\n",
        "    "
    ]
}

PLAY RECAP ************************************************************************************************************************************
localhost                  : ok=125  changed=39   unreachable=0    failed=0    skipped=53   rescued=0    ignored=0   

Después de la instalación, debería ver el archivo de configuración para cada perfil VPN usando el siguiente comando:

ls configs/your-server-ip/wireguard/

Debería ver todo el perfil en el siguiente resultado:

apple  desktop.conf  desktop.png  laptop.conf  laptop.png  phone.conf  phone.png  user1.conf  user1.png

Puede usar cualquiera de los archivos anteriores en su dispositivo cliente para conectarse al servidor Algo VPN.

Conclusión

¡Felicidades! Ha instalado y configurado con éxito Algo VPN en el servidor Ubuntu 20.04. Ahora puede configurar su dispositivo Windows, Linux o Android para conectarse al servidor Algo VPN.


Ubuntu
  1. Cómo instalar y configurar el servidor DHCP en Ubuntu 20.04

  2. Cómo instalar y configurar el servidor Redis en Ubuntu

  3. Cómo instalar y configurar Squid Proxy en Ubuntu 20.04

  4. Cómo instalar y configurar el servidor web Apache en Ubuntu 13.10

  5. Cómo instalar y configurar strongSwan VPN en Ubuntu 18.04

Cómo instalar y configurar el servidor LAMP en Ubuntu

Cómo instalar y configurar el servidor OpenLDAP en Ubuntu 16.04

Cómo instalar y configurar el servidor VNC en Ubuntu 20.04

Cómo instalar y configurar VNC en Ubuntu Server 20.04

Cómo instalar y configurar el servidor DNS en Ubuntu 16.04 LTS

Cómo instalar y configurar Parse Server en Ubuntu 20.04