Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash pass typed yes to EasyRSA gen-req

Tags:

bash

Problem: I'm trying to script an EasyRSA key gen request, but, if the key file already exists, any attempt to overwrite using yes or echo yes commands result in Aborting without confirmation. I believe EasyRSA is requiring me to actually type 'yes' and anything else results in an abort.

I'm wondering if there's another way to pass 'yes' to a prompt that requires a typed response?

What I've tried: yes | <command>, yes yes | <command> and echo yes | <command>

like image 646
Chimera.Zen Avatar asked Sep 15 '25 14:09

Chimera.Zen


1 Answers

Try it:

easyrsa --batch gen-req $servername nopass

From the man page:

--batch         : set automatic (no-prompts when possible) mode
like image 101
Андрей Проказа Avatar answered Sep 18 '25 10:09

Андрей Проказа