Failed to create certificate when I want to run source ./vars and ./clean-all [closed]
Asked Answered
F

1

7

I found a similar thread, but it still doesn't fix my issue.(OpenVPN Source vars not working on debian)

I was setting up OpenVPN according to https://help.ubuntu.com/14.04/serverguide/openvpn.html

and there was a problem when I tried to create my certificate according to the following guide:

cd /etc/openvpn/easy-rsa/ ## move to the easy-rsa directory
sudo chown -R root:admin . ## make this directory writable by the system administrators
source ./vars ## execute your new vars file
./clean-all ## Setup the easy-rsa directory (Deletes all keys)
./build-dh ## takes a while consider backgrounding
./pkitool --initca ## creates ca cert and key
./pkitool --server server ## creates a server cert and key
cd keys
openvpn --genkey --secret ta.key ## Build a TLS key
cp server.crt server.key ca.crt dh1024.pem ta.key ../../

when I try:

source ./vars

the shell gives me back:

NOTE: If you run ./clean-all, I will be doing a rm -r on /etc/openvpv/easy-rsa/keys

I ignored it and tried the next line:

sudo ./clean-all

it then says:

Please source the vars script first (i.e. "source ./vars")
Make sure you have edited it to reflect your configuration

I searched in google and stackoverflow, failed to resolve the problem.

Thanks for your help

Could anyone help me?

Fraley answered 1/12, 2014 at 3:27 Comment(1)
This question appears to be off-topic because it is not about programming. Perhaps the Ubuntu Stack Exchange would be a better place to ask.Nordin
S
11
  1. Restart the PC
  2. Open the terminal and type sudo su to log in as root
  3. move to the easy-rsa directory (on mine, the files are in easy-rsa/2.0/)
  4. type mkdir keys
  5. type source ./vars
  6. type ./clean-all
  7. type ./build-ca

    all the same commands as before but having created the keys directory and actually being logged in as root, instead of running it with sudo seemed to do the trick

Taken from here: http://ubuntuforums.org/showthread.php?t=801135

Solidus answered 1/12, 2014 at 3:31 Comment(2)
Yes. it works. I used su - to switch root account and it can run. thx.Fraley
mkdir keys was the real point for me, I thought easy-rsa could handle it by itself.Bittencourt

© 2022 - 2024 — McMap. All rights reserved.