pivpn: //INSTALL_USER: No such file or directory.

PiVPN Issue Template

Issue

When using pivpn -a nopass I get the error: cat: /etc/pivpn/INSTALL_USER: No such file or directory. Continuing it tries to write to a non existing directory of /home//

Have you searched for similar issues and solutions?

(yes/no / which issues?)

Yes, this issue appears a lot. Solutions range from uninstalling and reinstalling. I’ve tried that with Ubuntu and Debian and neither work.

Console output of curl -L install.pivpn.io | bash

    curl -L https://install.pivpn.io | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   178  100   178    0     0    151      0  0:00:01  0:00:01 --:--:--   151
100 53084  100 53084    0     0  32656      0  0:00:01  0:00:01 --:--:-- 32656
:::
::: You are root.
::: Verifying free disk space...
OK
::: Adding OpenVPN repo for Ubuntu xenial ... done!
:::
::: Checking apt-get for upgraded packages.... done!
:::
::: Your system is up to date! Continuing with PiVPN installation...
::: Using User: vpn
:::
::: Checking for existing base files...
:::    Checking /etc/.pivpn is a repo...:::    Cloning https://github.com/pivpn/pivpn.git into /etc/.pivpn... done!
:::
::: Stopping OpenVPN service... done.
:::   
::: Installing scripts to /opt/pivpn... done.
::: Using protocol: udp
set_var EASYRSA_ALGO       ec
set_var EASYRSA_CURVE      secp521r1
::: Building CA...
Generating a 521 bit EC private key
writing new private key to '/etc/openvpn/easy-rsa/pki/private/ca.key.3Snqnnsbbs'
-----

::: CA Complete.

Note: using Easy-RSA configuration from: ./vars
Generating a 521 bit EC private key
writing new private key to '/etc/openvpn/easy-rsa/pki/private/server_yQCu9Ylzj3OFVefP.key.yI47WUKJks'
-----
Using configuration from /etc/openvpn/easy-rsa/openssl-easyrsa.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
commonName            :ASN.1 12:'server_yQCu9Ylzj3OFVefP'
Certificate is to be certified until Apr  3 19:07:40 2029 GMT (3650 days)

Write out database with 1 new entries
Data Base Updated

Note: using Easy-RSA configuration from: ./vars
Using configuration from /etc/openvpn/easy-rsa/openssl-easyrsa.cnf

An updated CRL has been created.
CRL file: /etc/openvpn/easy-rsa/pki/crl.pem

net.ipv4.ip_forward = 1
iptables v1.6.0: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
::: Install Complete...
::: Restarting services...
::: done.
:::
::: Installation Complete!
::: Now run 'pivpn add' to create an ovpn profile for each of your devices.
::: Run 'pivpn help' to see what else you can do!
::: It is strongly recommended you reboot after installation.
:::
::: The install log is located at: /etc/pivpn/install.log

Console output of pivpn add or pivpn add nopass

 $ pivpn add nopass
cat: /etc/pivpn/INSTALL_USER: No such file or directory
Enter a Name for the Client:  test
spawn ./easyrsa build-client-full test nopass

Note: using Easy-RSA configuration from: ./vars
Generating a 256 bit EC private key
writing new private key to '/etc/openvpn/easy-rsa/pki/private/test.key.0B24r0M63x'
-----
Using configuration from /etc/openvpn/easy-rsa/openssl-easyrsa.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
commonName            :ASN.1 12:'test'
Certificate is to be certified until Apr  3 19:16:33 2029 GMT (3650 days)

Write out database with 1 new entries
Data Base Updated
Client's cert found: test.crt
Client's Private Key found: test.key
CA public Key found: ca.crt
tls-auth Private Key found: ta.key
cat: Default.txt: No such file or directory
cp: cannot create regular file '/home//ovpns/test.ovpn': No such file or directory
chown: cannot access '/home//ovpns/test.ovpn': No such file or directory


========================================================
Done! test.ovpn successfully created! 
test.ovpn was copied to:
  /home//ovpns
for easy transfer. Please use this profile only on one
device and create additional profiles for other devices.
========================================================


Console output of pivpn debug

  $ pivpn debug
cat: /etc/pivpn/NO_UFW: No such file or directory
::: Generating Debug Output
:::					:::
::		PiVPN Debug		 ::
:::					:::
::	Latest Commit			 ::
:::					:::
commit e4fd3703788a1095e3b4f6c186eefc94e82b2a78
Author: 4s3ti <cfcolaco@gmail.com>
Date:   Fri Mar 29 09:47:27 2019 +0100

    Update ISSUE_TEMPLATE.md
:::					:::
::	Recursive list of files in	 ::
::	/etc/openvpn/easy-rsa/pki	 ::
:::					:::
/etc/openvpn/easy-rsa/pki/:
ca.crt
crl.pem
ecparams
index.txt
index.txt.attr
index.txt.attr.old
index.txt.old
issued
private
serial
serial.old
ta.key
test.ovpn

/etc/openvpn/easy-rsa/pki/ecparams:
prime256v1.pem

/etc/openvpn/easy-rsa/pki/issued:
server_v9kZh633CRqzi6S1.crt
test.crt

/etc/openvpn/easy-rsa/pki/private:
ca.key
server_v9kZh633CRqzi6S1.key
test.key
:::					:::
::	Output of /etc/pivpn/*		 ::
:::					:::
:: START /etc/pivpn/INSTALL_PORT ::
1194
:: END /etc/pivpn/INSTALL_PORT ::
:: START /etc/pivpn/INSTALL_PROTO ::
udp
:: END /etc/pivpn/INSTALL_PROTO ::
:: START /etc/pivpn/pivpnINTERFACE ::

:: END /etc/pivpn/pivpnINTERFACE ::
:: START /etc/pivpn/TWO_POINT_FOUR ::
:: END /etc/pivpn/TWO_POINT_FOUR ::
:::					:::
:: /etc/openvpn/easy-rsa/pki/Default.txt ::
:::					:::
cat: /etc/openvpn/easy-rsa/pki/Default.txt: No such file or directory
:::					:::
::	Debug Output Complete		 ::
:::					:::
::: 
::: Debug output completed above.
::: Copy saved to /tmp/debug.txt
::: 

Console Output of sudo iptables -t nat -S

  iptables v1.6.0: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Console Output of sudo iptables -S

  $ sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT

output of sudo netstat -uanp | grep openvpn

  $sudo netstat -uanp | grep openvpn
$

Have you taken any steps towards solving your issue?

 which?

I’ve tried uninstalling, reinstalling, running as a normal user, running as root, tried both of these under Debian and Ubuntu. I’m using the Linux kernel version 2.6.32 as that’s all my VPS provider can use and I’ve failed to manage to update the Kernel.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 25 (6 by maintainers)

Most upvoted comments

That was exactly my case, as the one of @ionwerz. I fixed it by inspecting the installation script, because in fact the installation seems to fail while installing easy-rsa, but no errors are shown during installation. The only thing that I noticed is that it never produces the RSA keys for the server during the VPN configuration.

To fix the easy-rsa related issues, I downloaded the installation script and modified it slightly: curl -L https://install.pivpn.io > install.sh

Then, use a text editor, like nano to comment-out some lines. At line 756, the installer checks for easy-rsa in the OpenVPN directory, /etc/openvpn/easy-rsa. If it is present, it deletes it, and then it tries to download a version which is compatible with PiVPN from the Git repository here. (For some reason, this seems to fail?)

In my installer it wants easy-rsa version 3.0.6 (you can see that at the first lines of the installer). Therefore, I uncomment these lines, which delete existing easy-rsa installations and downloads the one from git:

# In nano, you can quickly go to the line by Ctrl+W and then Ctrl+T

    # If easy-rsa exists, remove it
#    if [[ -d /etc/openvpn/easy-rsa/ ]]; then
#        $SUDO rm -rf /etc/openvpn/easy-rsa/
#  fi

    # Get the PiVPN easy-rsa
#    wget -q -O - "${easyrsaRel}" | $SUDO tar xz -C /etc/openvpn && $SUDO mv /etc/openvpn/EasyRSA-${easyrsaVer} /etc/openvpn/easy-rsa

Save the file by Ctrl+X. Afterwards, we need to install that file on our own. For version 3.0.6 you can do this:

# Download the OpenVPN easy-rsa release 3.0.6
wget https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.6/EasyRSA-unix-v3.0.6.tgz
tar -xzvf EasyRSA-unix-v3.0.6.tgz          # Extract the files into EasyRSA-v3.0.6
sudo cp -r EasyRSA-v3.0.6 /etc/openvpn/easy-rsa            # Copy the files to the openvpn directory

Then, you can re-run the modified installation file and should hopefully be fine:

sudo bash install.sh      # Install the modified installer; it won't delete the easy-rsa files that we just downloaded

I don’t know if the INSTALL_USER issue of @Mu8Quecvejvu and the easy-rsa issue of @ionwerz are related, but it seems like the installation script has some issues or bugs. Hopefully this is a workaround for now.

Short story: While writing this, I found the source of the easy-rsa issue, the installer uses this URL, which is not correct (Gives 404): easyrsaRel="https://github.com/OpenVPN/easy-rsa/releases/download/v${easyrsaVer}/EasyRSA-${easyrsaVer}.tgz"

The correct variable should be this one: easyrsaRel="https://github.com/OpenVPN/easy-rsa/releases/download/v${easyrsaVer}/EasyRSA-unix-v${easyrsaVer}.tgz"

So if you change this on the top of the installation script and run it, then it should work out fine without manually placing easy-rsa in /etc/openvpn.

This is my modified install.sh file, unzip it, copy it in your pi folder and shh run it im sure it’ll work

install.sh.zip