Question

Problem with openVPN easy-rsa

Posted April 16, 2021 852 views
VPN

following the openVPN tutoria and step two keeps failing on something that seems very elementary, which is that it seems unable to find the file path. the code and error:


./easyrsa init-pki
-bash: ./easyrsa: No such file or directory

things I’ve tried: accessing as a different user, accessing from a different folder (rather than the cd ~/easy-rsa), modifying the vars path (currently it’s only the two lines recommended:


set_var EASYRSA_ALGO "ec"
set_var EASYRSA_DIGEST "sha512"

but I’ve tried that at the bottom, that plus setvar EASYRSAPKI “$EASYRSA/pki”, and others but nothing happens. I expect this is a super easy item that I’ve missed somewhere, because I can’t find any other stack overflow questions specifically on it, or the like. so if there’s an easy fix that you all expect I’m all ears. thanks kindly.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Hi,

Being logged in as the user that you installed Easy-RSA with, check the content of the directory ~/easy-rsa:

ls -la ~/easy-rsa/

As you followed DO tutorial, you should get a couple of symbolic links (symlinks) as a result of the above command. These symlinks lead to the files in the directory /usr/share/easy-rsa/. There should be a symlink to easyrsa script there too. Check the script name. Check whether it exists in the directory /usr/share/easy-rsa/:

sudo ls -la /usr/share/easy-rsa/easyrsa*

Let us know how it is going, pls.

  • huh, so the first command got:

    total 12
    drwx------ 3 root root 4096 Apr 16 03:21 .
    drwx------ 7 root root 4096 Apr 15 22:53 ..
    lrwxrwxrwx 1 root root   28 Apr 15 21:08 build-ca -> /usr/share/easy-rsa/build-ca
    lrwxrwxrwx 1 root root   28 Apr 15 21:08 build-dh -> /usr/share/easy-rsa/build-dh
    lrwxrwxrwx 1 root root   31 Apr 15 21:08 build-inter -> /usr/share/easy-rsa/build-inter
    lrwxrwxrwx 1 root root   29 Apr 15 21:08 build-key -> /usr/share/easy-rsa/build-key
    lrwxrwxrwx 1 root root   34 Apr 15 21:08 build-key-pass -> /usr/share/easy-rsa/build-key-pass
    lrwxrwxrwx 1 root root   36 Apr 15 21:08 build-key-pkcs12 -> /usr/share/easy-rsa/build-key-pkcs12
    lrwxrwxrwx 1 root root   36 Apr 15 21:08 build-key-server -> /usr/share/easy-rsa/build-key-server
    lrwxrwxrwx 1 root root   29 Apr 15 21:08 build-req -> /usr/share/easy-rsa/build-req
    lrwxrwxrwx 1 root root   34 Apr 15 21:08 build-req-pass -> /usr/share/easy-rsa/build-req-pass
    lrwxrwxrwx 1 root root   29 Apr 15 21:08 clean-all -> /usr/share/easy-rsa/clean-all
    lrwxrwxrwx 1 root root   33 Apr 15 21:08 inherit-inter -> /usr/share/easy-rsa/inherit-inter
    drwx------ 2 root root 4096 Apr 16 03:16 keys
    lrwxrwxrwx 1 root root   28 Apr 15 21:08 list-crl -> /usr/share/easy-rsa/list-crl
    lrwxrwxrwx 1 root root   37 Apr 15 21:08 openssl-0.9.6.cnf -> /usr/share/easy-rsa/openssl-0.9.6.cnf
    lrwxrwxrwx 1 root root   37 Apr 15 21:08 openssl-0.9.8.cnf -> /usr/share/easy-rsa/openssl-0.9.8.cnf
    lrwxrwxrwx 1 root root   37 Apr 15 21:08 openssl-1.0.0.cnf -> /usr/share/easy-rsa/openssl-1.0.0.cnf
    lrwxrwxrwx 1 root root   27 Apr 15 21:08 pkitool -> /usr/share/easy-rsa/pkitool
    lrwxrwxrwx 1 root root   31 Apr 15 21:08 revoke-full -> /usr/share/easy-rsa/revoke-full
    lrwxrwxrwx 1 root root   28 Apr 15 21:08 sign-req -> /usr/share/easy-rsa/sign-req
    lrwxrwxrwx 1 root root   24 Apr 15 21:08 vars -> /usr/share/easy-rsa/vars
    lrwxrwxrwx 1 root root   35 Apr 15 21:08 whichopensslcnf -> /usr/share/easy-rsa/whichopensslcnf
    

    the second:

    root@ubuntu:~# sudo ls -al //share/easy-rsa/easyrsa*
    ls: cannot access '//share/easy-rsa/easyrsa*': No such file or directory
    
    • Hi,

      The tutorial you mentioned assumes that your Ubuntu version is 20.04, and there is Easy-RSA ver. 3+ in its repository. Apparently, your OS version is different, since you get Easy-RSA 2.2.2-2 installed. Check a version of your system:

      cat /etc/os-release
      

      You will get a result like below. OS version is highlighted there.

      Output
      NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.5 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic

      Then, find and follow a tutorial appropriate to your OS version, e.g. this tutorial is for Ubuntu 18.04.

      I hope it helps.

      by Mark Drake
      OpenVPN is a full-featured, open-source Secure Socket Layer (SSL) VPN solution that accommodates a wide range of configurations. In this tutorial, you will set up an OpenVPN server on an Ubuntu 18.04 server and then configure access to it from Windows, OS X, iOS and/or Android devices. This tutorial will keep the installation and configuration steps as simple as possible for each of these setups.
      • yeah, so that was, in fact it. what I don’t get is when I spun up the droplet it was a 20.04 machine. I’ve double checked that, and don’t even see an option to spin up a 18; any idea how that might have happened?

        and thanks! great informative answers!

        • I am glad it helped :-)

          @deepbluesea wrote
          what I don’t get is when I spun up the droplet it was a 20.04 machine. I’ve double checked that, and don’t even see an option to spin up a 18; any idea how that might have happened?

          It has never happened to me but I could imagine the scenario that mouse auto-scroll does such mess during setting up droplet’s parameters.

          • I guess it’s certainly possible, although I didn’t even know there were other options, and had to go hunt after this post to find how to do this. I wonder if there was some other setting I’ve hit that sent me in that direction. surely since it happened twice I did something that made this so, but I can’t figure it out. anyhow, yes, huge help, thank you, and have a great evening.

additional info: tried

root@ubuntu:~/easy-rsa# sudo find ~/ -iname "easyrsa"
root@ubuntu:~/easy-rsa# sudo find / -iname "easyrsa"

neither returned anything, which makes me think that I missed an install somewhere but I’ve done:

sudo apt install openvpn easy-rsa
Reading package lists... Done
Building dependency tree       
Reading state information... Done
easy-rsa is already the newest version (2.2.2-2).
openvpn is already the newest version (2.4.4-2ubuntu1.3).
0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.

which was what every tutorial I’ve seen has…