Jump to content
ElementaryOS France
  • 0
bjornzd

Installer un VPN : Cyberghost

Question

Bonjour,

J'essaye en vain d'installer le VPN payant Cyberghost sous Elementary OS mais n'y parviens pas,

si quelqu'un en sait plus sur comment l'adapter à cet OS merci de le partager ici :)

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

Bonjour,

Voici la solution, il faut tout simplement supprimer la vérification de la version à l'installation pour ceci il faut modifier le fichier install.sh.

Commande : nano install.sh

Remplacer :

#!/bin/bash

   # if user is not running the command as root
   if [ "$UID" -ne 0 ]; then

      # output message
      echo "Please run the installer with SUDO!"

      # stop script
      exit
   fi

   # check update
   apt update > /dev/null 2>&1

   # output message
   echo -e "\nCyberGhost Installer ...\n"

   # get GLIBC version
   glibcVersion=$(ldd --version | grep -i ldd | awk -F' ' {'print $5'})
   
   # get distribution version
   ubuntuDistroVersion=$(lsb_release -sr)
   distroName=$(lsb_release -a | grep -i "Distributor ID:" | awk -F' ' {'print $3'})
   

   echo "Checking if glibc version is compatible"
   

   # check if GLIBC version is compatible
   if [ "$ubuntuDistroVersion" == "16.04" ]; then
         
      if [ "$glibcVersion" == "2.23" ] ; then

         echo "The glibc version is compatible, continue..."

      else

         echo "THe glibc version is incompatible, exiting setup..."
         exit

      fi

   elif [ "$ubuntuDistroVersion" == "18.04" ] || [ "$distroName" == "LinuxMint" ]; then
      
      if [ "$glibcVersion" == "2.27" ]; then
      
         echo "The glibc version is compatible, continue..."
      
      else
      
         echo "The glibc version is incompatible, exiting setup..."
         exit

      fi

   elif [ "$ubuntuDistroVersion" == "19.10" ]; then

      if [ "$glibcVersion" == "2.30" ]; then

         echo "The glibc version is compatible, continue..."

      else

         echo "The glibc version is incompatible, exiting setup..."
         exit
      fi

   elif [ "$distroName" == "Kali" ] || [ "$ubuntuDistroVersion" == "19.04" ]; then

      if [ "$glibcVersion" == "2.29" ]; then

         echo "The glibc version is compatible, continue..."
      
      else

         echo "The glibc version is incompatible, exiting setup..."
         exit
      
      fi
   else

      echo "Couldn't detect a valid version of your distribution."
      echo "Make sure you have downloaded the correct install package for your distribution"
      echo "Note: We support only the following distributions for Debian based OS:"
      echo ""
      echo "-Ubuntu 16.04 "
      echo "-Ubuntu 18.04 "
      echo "-Ubuntu 19.04 "
      echo "-Ubuntu 19.10 "
      echo "-Linux Mint 19.2 "
      echo "-PopOS 19.10 "
      echo "-Kali 2019/2020 (glibc version should be 2.29 in order to work) "
      exit

   fi         


   # define required packages
    requiredPackages=(curl openvpn resolvconf wireguard)

   # loop through packages
    for package in "${requiredPackages[@]}"; do

      # set package
      p="$package"

      # if package is opwireguardenvpn
      if [ "$package" == "wireguard" ]; then

         # check if wireguard ppa exist
         responseCode=$(grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -c wireguard)

         # if ppa does not exist
         if [ "$responseCode" == "0" ]; then

            # install wireguard ppa
            add-apt-repository -y ppa:wireguard/wireguard > /dev/null 2>&1
            apt update > /dev/null 2>&1
         fi

         # change package name
         p="wg"
      fi

      # check if package is installed and get exit code
        responseCode=$(which "$p" > /dev/null 2>&1; echo "$?")

      # output message
      echo -n "Check if \"$package\" package is already installed ... "

      # if package is installed
        if [ "$responseCode" == "0" ]; then

         # output message
         echo "Yes"

         # if package is openvpn
         if [ "$package" == "openvpn" ]; then

            # get openvpn version
            openvpnVersion=$(openvpn --version | head -n 1 | awk '{print $2}')

            # get major version
            majorVersion=$(echo "$openvpnVersion" | awk -F. '{print $1}')

            # get minor version
            minorVersion=$(echo "$openvpnVersion" | awk -F. '{print $2}')

            # output message
            echo -n "Checking OpenVPN version ... "

            if [ $majorVersion -ge 2 ] && [ $minorVersion -gt 3 ]; then

               # output message
               echo "Latest ..."
            else

               # output message
               echo "The OpenVPN version is too old ... "
               echo "Removing old package ... "

               # uninstall package
               apt remove "$package" -y > /dev/null 2>&1

               # output message
               echo -n "Installing new package ... "
               curl -s https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add -
               echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
               apt update > /dev/null 2>&1
               apt install "$package" -y > /dev/null 2>&1

               # output message
               echo "Done."
            fi
         fi
        else

         # output message
            echo -n "No, installing ... "

         if [ "$package" == "openvpn" ]; then

            # get openvpn version from apt
            openvpnVersion=$(apt show openvpn|grep "Version:" | awk '{ print $2 }')
            version=$(echo "$openvpnVersion"| awk -F'-' '{print $1}')
            
            # get major version
            majorVersion=$(echo "$version" | awk -F. '{print $1}')

            # get minor version
            minorVersion=$(echo "$version" | awk -F. '{print $2}')

            # if version is lower then 2.4
            if [ $majorVersion -ge 2 ] && [ $minorVersion -lt 4 ]; then
               curl -s https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add -
               echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
               apt update > /dev/null 2>&1
            fi
         fi


         # install package
            apt install "$package" -y > /dev/null 2>&1

         # output message
            echo "Done."
        fi
    done

   # output message
   echo "Continue ..."

   # if directory exist
   if [ -d /usr/local/cyberghost ]; then

      # remove directory
      rm -rf /usr/local/cyberghost
   fi

   echo "Installing application ..."

   # if logs directory does not exist
   if [ ! -d /usr/local/cyberghost ]; then

      # create logs directory if not exist
      mkdir /usr/local/cyberghost
   fi

   # copy certificates to local directory
   cp -r cyberghost/* /usr/local/cyberghost

   # change directory permissions
   chmod -R 755 /usr/local/cyberghost

   # output message
   echo "Create symlinks ..."

   # if symlink exist
   if [ -L /usr/bin/cyberghostvpn ]; then

      # remove old symlink
      rm /usr/bin/cyberghostvpn
   fi

   # create symlink
   ln -sf /usr/local/cyberghost/cyberghostvpn /usr/bin/cyberghostvpn

   # setup application
   cyberghostvpn --setup

PAR :

#!/bin/bash

   # if user is not running the command as root
   if [ "$UID" -ne 0 ]; then

      # output message
      echo "Please run the installer with SUDO!"

      # stop script
      exit
   fi

   # check update
   apt update > /dev/null 2>&1

   # output message
   echo -e "\nCyberGhost Installer ...\n"

   # get GLIBC version
   glibcVersion=$(ldd --version | grep -i ldd | awk -F' ' {'print $5'})
   
   # get distribution version
   ubuntuDistroVersion=$(lsb_release -sr)
   distroName=$(lsb_release -a | grep -i "Distributor ID:" | awk -F' ' {'print $3'})
   

   echo "Checking if glibc version is compatible"
   

   # define required packages
    requiredPackages=(curl openvpn resolvconf wireguard)

   # loop through packages
    for package in "${requiredPackages[@]}"; do

      # set package
      p="$package"

      # if package is opwireguardenvpn
      if [ "$package" == "wireguard" ]; then

         # check if wireguard ppa exist
         responseCode=$(grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -c wireguard)

         # if ppa does not exist
         if [ "$responseCode" == "0" ]; then

            # install wireguard ppa
            add-apt-repository -y ppa:wireguard/wireguard > /dev/null 2>&1
            apt update > /dev/null 2>&1
         fi

         # change package name
         p="wg"
      fi

      # check if package is installed and get exit code
        responseCode=$(which "$p" > /dev/null 2>&1; echo "$?")

      # output message
      echo -n "Check if \"$package\" package is already installed ... "

      # if package is installed
        if [ "$responseCode" == "0" ]; then

         # output message
         echo "Yes"

         # if package is openvpn
         if [ "$package" == "openvpn" ]; then

            # get openvpn version
            openvpnVersion=$(openvpn --version | head -n 1 | awk '{print $2}')

            # get major version
            majorVersion=$(echo "$openvpnVersion" | awk -F. '{print $1}')

            # get minor version
            minorVersion=$(echo "$openvpnVersion" | awk -F. '{print $2}')

            # output message
            echo -n "Checking OpenVPN version ... "

            if [ $majorVersion -ge 2 ] && [ $minorVersion -gt 3 ]; then

               # output message
               echo "Latest ..."
            else

               # output message
               echo "The OpenVPN version is too old ... "
               echo "Removing old package ... "

               # uninstall package
               apt remove "$package" -y > /dev/null 2>&1

               # output message
               echo -n "Installing new package ... "
               curl -s https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add -
               echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
               apt update > /dev/null 2>&1
               apt install "$package" -y > /dev/null 2>&1

               # output message
               echo "Done."
            fi
         fi
        else

         # output message
            echo -n "No, installing ... "

         if [ "$package" == "openvpn" ]; then

            # get openvpn version from apt
            openvpnVersion=$(apt show openvpn|grep "Version:" | awk '{ print $2 }')
            version=$(echo "$openvpnVersion"| awk -F'-' '{print $1}')
            
            # get major version
            majorVersion=$(echo "$version" | awk -F. '{print $1}')

            # get minor version
            minorVersion=$(echo "$version" | awk -F. '{print $2}')

            # if version is lower then 2.4
            if [ $majorVersion -ge 2 ] && [ $minorVersion -lt 4 ]; then
               curl -s https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add -
               echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
               apt update > /dev/null 2>&1
            fi
         fi


         # install package
            apt install "$package" -y > /dev/null 2>&1

         # output message
            echo "Done."
        fi
    done

   # output message
   echo "Continue ..."

   # if directory exist
   if [ -d /usr/local/cyberghost ]; then

      # remove directory
      rm -rf /usr/local/cyberghost
   fi

   echo "Installing application ..."

   # if logs directory does not exist
   if [ ! -d /usr/local/cyberghost ]; then

      # create logs directory if not exist
      mkdir /usr/local/cyberghost
   fi

   # copy certificates to local directory
   cp -r cyberghost/* /usr/local/cyberghost

   # change directory permissions
   chmod -R 755 /usr/local/cyberghost

   # output message
   echo "Create symlinks ..."

   # if symlink exist
   if [ -L /usr/bin/cyberghostvpn ]; then

      # remove old symlink
      rm /usr/bin/cyberghostvpn
   fi

   # create symlink
   ln -sf /usr/local/cyberghost/cyberghostvpn /usr/bin/cyberghostvpn

   # setup application
   cyberghostvpn --setup

Cela fonctionne très bien. Bonne soirée !

Share this post


Link to post
Share on other sites
  • 0

pas oublié de vider le sources.list et supprimer wirecard dans /etc/apt/sources.list.d/

Et faire un sudo apt-get update

 

Share this post


Link to post
Share on other sites
  • 0

Comme je disais plus haut, ça fonctionne sur mon macbook mais pas sur mon pc étrangement.

olivier@olivier:~/Downloads/cyberghostvpn-ubuntu-18.04-1.3.2$ sudo bash install.sh
[sudo] password for olivier: 

CyberGhost Installer ...

No LSB modules are available.
Checking if glibc version is compatible
Check if "curl" package is already installed ... Yes
Check if "openvpn" package is already installed ... Yes
Checking OpenVPN version ... Latest ...
Check if "resolvconf" package is already installed ... Yes
Check if "wireguard" package is already installed ... Yes
Continue ...
Installing application ...
Create symlinks ...
Do you want to override the original configuration file? [Y/n]: Y
Setup account ...
Enter CyberGhost username and press [ENTER]: x
Enter CyberGhost password and press [ENTER]: y
Traceback (most recent call last):
  File "cyberghostvpn.py", line 761, in <module>
  File "cyberghostvpn.py", line 370, in main
  File "cyberghostvpn.py", line 233, in setup
  File "cyberghostvpn.py", line 84, in createAccount
  File "libs/config.py", line 90, in getConfig
Exception: The section "account" is missing configuration file!
[24345] Failed to execute script cyberghostvpn

Du coup j'ai essayé une autre approche, celle-ci :

https://support.cyberghostvpn.com/hc/en-us/articles/213189889-How-to-configure-OpenVPN-for-Linux-Ubuntu-Terminal-

Tout en faisant ça depuis Elementary OS et sa configuration VPN intégrée.

Bizarrement, Elementary OS me dit que tout est ok, qu'il est bien connecté. Or si je vais sur le site de Cyberghost j'ai toujours le statut Non-Protégé...

J'ai bien du mal à comprendre.

Share this post


Link to post
Share on other sites
  • 0

Malheureusement, cela va s'avérer assez compliqué à dépanner, sans avoir de compte Cyberghost, ça sera quasiment mission impossible de pouvoir t'aider

Share this post


Link to post
Share on other sites
  • 0

Désolé pour le déterrage.

Je raconte un peu ma vie mais du coup je cherche un moyen sous mon Elementary OS de pouvoir télécharger librement avec mon VPN CyberGhost comme vous l'aurez compris.

N'arrivant pas à faire fonctionner le VPN je cherche une autre méthode. Je cherche une solution viable.

Télécharger dans une VM dans Elementary OS avec ledit VPN et faire du drag and drop entre les machines ? 😃

Utiliser Wine et CyberGhost ? 😃

Me tourner vers une box dédiée ? Ou un seedbox ?

Je suis desespéré.

Share this post


Link to post
Share on other sites
  • 0

Salut @bjornzd

comme dit, c'est presque impossible à dépanner, à moins que... tu ne nous trouves ces fichiers python dont il est question, en général les fichiers python sont en clair, ils ne sont ni masqués, ni transformés en exécutables, essaie de nous trouver dans ces 2 fichiers cyberghostvpn.py et libs/config.py les lignes indiquées dans le message d'erreur et peut-être qu'on aura de la chance. Il semble qu'il manque un paramètre account dans un fichier de config.

 

 

Share this post


Link to post
Share on other sites
  • 0

Je ne trouve pas les fichiers python en question sur mon système.

C'est possible qu'ils n'existent pas...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...