P
panzaeron
Jungspund
Hallo, nach dem mein sed-Problem gelöst ist, gleich die nächste Frage
Ich möchte durch ein Skript möglichst automatisch openssl Zertifikate für OpenVPN-Clients erstellen.
Bisher erstelle ich die Clients so:
wobei $BK ein Benutzerkürzel ist, welcher beim Aufrufen des Skripts übergeben wird. Soweit funktioniert das alles ganz gut. Aber leider fragt openssl beim erstellen noch verschiedene Parameter ab:
Die Angaben die abgefragt werden, sollen mit Standardwerten bzw. mit Werten aus einer Datenbank automatisch ausgefüllt werden. Kann ich diese in den openssl Aufruf integrieren? Ich habe im Internet und der Doku keine passenden Optionen gefunden. Hat jemand einen Rat?
Ich möchte durch ein Skript möglichst automatisch openssl Zertifikate für OpenVPN-Clients erstellen.
Bisher erstelle ich die Clients so:
Code:
...
#
# Schlüsselpaar generieren
#
if test $KEY_DIR; then
echo "Generiere Schlüsselpaar für $BK..."
openssl req -days 3650 -nodes -new -keyout $KEY_DIR/vpn_$BK.key -out $KEY_DIR/vpn_$BK.csr -config $KEY_CONFIG && \
openssl ca -days 3650 -out $KEY_DIR/vpn_$BK.crt -in $KEY_DIR/vpn_$BK.csr -config $KEY_CONFIG -subject && \
chmod 0600 $KEY_DIR/vpn_$BK.key
else
echo 'Kein Schlüsselverzeichnis (KEY_DIR) definiert.'
exit 1;
fi
Code:
..
writing new private key to '/etc/openvpn/keys/vpn_sdas.key'
-----
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.
-----
Country Name (2 letter code) [DE]:
State or Province Name (full name) [Bundesland]:
Locality Name (eg, city) [Stadt]:
Organization Name (eg, company) [Firma]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []: vpn_BK
Email Address [bbs@bbs-walsrode.de]:mail@adresse.de
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Using configuration from /etc/openvpn/easy-rsa/openssl.cnf
..
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y