LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-09-2018, 02:05 AM   #1
banderas20
Member
 
Registered: Aug 2018
Posts: 138

Rep: Reputation: Disabled
Unhappy EasyRSA. Can't generate CA :(


Hello,

I'm trying to build a PKI using EasyRSA. It's meant to be easy, but I'm bumping innto many problems:

I edit "vars" file. I issue "source vars". Then, "./build-ca"

And I have found these errors so far:

Code:
pkitool: KEY_CONFIG (set by the ./vars script) is pointing to the wrong
version of openssl.cnf: /etc/openvpn/easy-rsa/openssl.cnf
The correct version should have a comment that says: easy-rsa version 2.x
Another one:
Code:
**************************************************************
  No /etc/openvpn/easy-rsa/openssl.cnf file could be found
  Further invocations will fail
**************************************************************
Contents of openssl.cnf:
Code:
!/bin/sh

cnf="$1/openssl.cnf"

if [ "$OPENSSL" ]; then
    if $OPENSSL version | grep -E "0\.9\.6[[:alnum:]]?" > /dev/null; then
        cnf="$1/openssl-0.9.6.cnf"
    elif $OPENSSL version | grep -E "0\.9\.8[[:alnum:]]?" > /dev/null; then
        cnf="$1/openssl-0.9.8.cnf"
    elif $OPENSSL version | grep -E "1\.0\.[[:digit:]][[:alnum:]]?" > /dev/null; then
        cnf="$1/openssl-1.0.0.cnf"
    else
        cnf="$1/openssl.cnf"
    fi
fi

echo $cnf

if [ ! -r $cnf ]; then
    echo "**************************************************************" >&2
    echo "  No $cnf file could be found" >&2
    echo "  Further invocations will fail" >&2
    echo "**************************************************************" >&2
fi

exit 0
Contents of "vars" file:
Code:
# easy-rsa parameter settings

# NOTE: If you installed from an RPM,
# don't edit this file in place in
# /usr/share/openvpn/easy-rsa --
# instead, you should copy the whole
# easy-rsa directory to another location
# (such as /etc/openvpn) so that your
# edits will not be wiped out by a future
# OpenVPN package upgrade.

# This variable should point to
# the top level of the easy-rsa
# tree.
export EASY_RSA="`pwd`"

#
# This variable should point to
# the requested executables
#
export OPENSSL="openssl"
export PKCS11TOOL="pkcs11-tool"
export GREP="grep"


# This variable should point to
# the openssl.cnf file included
# with easy-rsa.
export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA`

# Edit this variable to point to
# your soon-to-be-created key
# directory.
#
# WARNING: clean-all will do
# a rm -rf on this directory
# so make sure you define
# it correctly!
export KEY_DIR="$EASY_RSA/keys"

# Issue rm -rf warning
echo NOTE: If you run ./clean-all, I will be doing a rm -rf on $KEY_DIR
# PKCS11 fixes
export PKCS11_MODULE_PATH="dummy"
export PKCS11_PIN="dummy"

# Increase this to 2048 if you
# are paranoid.  This will slow
# down TLS negotiation performance
# as well as the one-time DH parms
# generation process.
export KEY_SIZE=2048

# In how many days should the root CA key expire?
export CA_EXPIRE=3650

# In how many days should certificates expire?
export KEY_EXPIRE=3650

# These are the default values for fields
# which will be placed in the certificate.
# Don't leave any of these fields blank.
export KEY_COUNTRY="ES"
export KEY_PROVINCE="BA"
export KEY_CITY="Barcelona"
export KEY_ORG="HomeTest"
export KEY_EMAIL="me@myhost.mydomain"
export KEY_OU="MyOrganizationalUnit"

# X509 Subject Field
export KEY_NAME="EasyRSA"

# PKCS11 Smart Card
# export PKCS11_MODULE_PATH="/usr/lib/changeme.so"
# export PKCS11_PIN=1234

# If you'd like to sign all keys with the same Common Name, uncomment the KEY_CN export below
# You will also need to make sure your OpenVPN server config has the duplicate-cn option set
# export KEY_CN="CommonName"
¿What happens? ¿Maybe a mismatch of versions?

Thanks!
 
Old 08-10-2018, 04:25 AM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
Do you need the PKI file for your UEFI Bios?
 
Old 08-10-2018, 11:52 AM   #3
banderas20
Member
 
Registered: Aug 2018
Posts: 138

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Keruskerfuerst View Post
Do you need the PKI file for your UEFI Bios?
No. For OpenVPN
 
Old 08-10-2018, 12:02 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
The error said
Code:
/etc/openvpn/easy-rsa/openssl.cnf
but you posted a openssl.cnf file (??)

Is the file you posted at that location?

What are its permissions?
 
Old 08-10-2018, 12:17 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by banderas20 View Post
No. For OpenVPN
This sounds familiar:
https://www.linuxquestions.org/quest...sa-4175635749/
https://www.linuxquestions.org/quest...ca-4175635834/

Again: OpenSSL/SSH is **NOT** what you need for a certificate. There are over 124,000 hits in Google for "easy-rsa openvpn linux"; some of the first are:
https://openvpn.net/index.php/open-s...anagement.html
https://community.openvpn.net/openvp...-OpenVPN-Howto

...from the OpenVPN site, with instructions. There are also a good number of guides on how to install easy-rsa for pretty much any version/distro of Linux.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] FYI: how to resolve "failed to update database: txt_db error number 2" in OpenSSL or EasyRSA sundialsvcs Linux - Security 0 08-20-2016 06:52 PM
Generate CA help saman Linux - Wireless Networking 1 04-22-2008 05:25 AM
How to generate *.ko for 2.6 kernel kiran@ccpu Linux - Software 4 11-05-2007 11:19 PM
how to generate .so abd_bela Programming 1 01-31-2006 04:12 AM
How to generate ps from texinfo abd_bela Debian 1 05-02-2005 06:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration