15

With the newer v3 version of easy-rsa I could not find a way to silently feed data to the command line:

$ ./easyrsa build-ca nopass

Note: using Easy-RSA configuration from: ./vars
Generating a 2048 bit RSA private key
...............................................................................................................................................................+++
...............................................................................+++
writing new private key to '~/EasyRSA-3.0.4/pki/private/ca.key.Dz9CBy9xV1'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Common Name (eg: your user, host, or server name) [Easy-RSA CA]:

I've tried fiddling with the files openssl-easyrsa.cnf and vars but to no avail.

I'm automating these operations inside a docker container entrypoint which is why I can't go with anything interactive.

Sebas
  • 461
  • 4
  • 12

2 Answers2

20

Okay, that was as simple as doing this before running easyrsa:

# export EASYRSA_BATCH=1
Sebas
  • 461
  • 4
  • 12
  • Thanks! I tried set_var EASYRSA_BATCH "yes" in the vars file, but that didn't work. Running export EASYRSA_BATCH=1 did the trick. – ndbroadbent Sep 16 '19 at 13:23
0

The reason it did not work when you...

set EASYRSA_BATCH "yes"

Is that you have to:

set it to EASYRSA_BATCH "1".

It worked for me.

Io-oI
  • 8,193
P.A.
  • 1