Dieses Script erzeugt mehrere CSR welche man extern zum Signieren einreichen kann.
#!/bin/bash
#– —————————————————————————–
#– Script : /tmp/crea_csr.sh
#– Task : This script will generate the csr for several domains at once.
#– Usage : ./crea_csr.sh
#– Author : Stefan M. Dohn, 01.04.2017
#– 01.04.2017 SDohn Creation from scrap.
#– Last updates: 01.04.2017 18:10
#– —————————————————————————–
#set -x
#
cd /tmp/KGW/
PARM="tdredaktion.qs.sdohn.com
td-web-u.sdohn.com
tdcontentweb.qs.sdohn.com
tdstage1.qs.sdohn.com
tdstage2.qs.sdohn.com
devredaktion.dev.sdohn.com
devcontentweb.dev.sdohn.com
devstage1.dev.sdohn.com
devstage2.dev.sdohn.com"
for i in $PARM
do
echo $i
CNAME=$i
openssl genrsa -des3 -out $CNAME.key 2048
openssl rsa -noout -in $CNAME.key
openssl req -new -key $CNAME.key -out $CNAME.csr -subj "/C=DE/ST=Stade/L=Stade/O=Sdohn Security/OU=IT /CN=$CNAME"
openssl rsa -in /tmp/KGW/$CNAME.key -out /tmp/KGW/$CNAME.key1
mv /tmp/KGW/$CNAME.key1 /tmp/KGW/$CNAME.key
done