easyrsa , build-client-full : name. , , , , , , . , , stdin.
easyrsa
. OpenSSL ( easyrsa) stdin
. , "-passout stdin" (
, ) OpenSSL. "-passout file:passfile", passfile'. To make
it harder, easyrsa`,
OpenSSL. , - .
.
, gen_req
easyrsa local opts=:
gen_req() {
....
local opts=
opts="-passout stdin"
....
}
, , OpenSSL stdin
( gen_req), CA
( sign_req). , OpenSSL
stdin ( )
sign_req() {
local crt_type="$1" opts=
opts="-passin file:capassfile"
...
}
(. , , OpenSSL ...)
" " №1:
stdin - , easyrsa, , . :
#!/bin/bash
clients=3
pass=randompass
for i in `seq 1 $clients`
do
(echo $pass; echo $pass) | ./easyrsa build-client-full test$i
done
(echo $pass; echo ...)
printf '%s\n' $pass $pass | ./easyrsa build-client-full test$i
echo -e "$pass\n$pass" | ./easyrsa build-client-full test$i
, .
" " # 2: stdin
, , (, ps) , , , . , :
randompass
randompass
easyrsa , :
...
for i in `seq 1 $clients`
do
./easyrsa build-client-full test$i <passfile
done
passfile - . , , , .