Renew CAcert

From d00d3
Jump to: navigation, search

Attention: replace the MACHINE variable (d00d3, user)!

export MACHINE=d00d3
export DATE=`date +%F-%H-%M-%S`

#backup:
mkdir -p /etc/certbackup/${DATE}
cp -a /etc/${MACHINE}_* /etc/certbackup/${DATE}

#renew:
cd /tmp
cp -a /etc/${MACHINE}_privatekey.pem .
# paste renewed CAcert certificate into ${MACHINE}_publiccert.pem
cat ${MACHINE}_publiccert.pem ${MACHINE}_privatekey.pem > ${MACHINE}_pubpriv.pem
chmod 640 ${MACHINE}_pubpriv.pem ${MACHINE}_privatekey.pem
chown root:sslusers ${MACHINE}_pubpriv.pem ${MACHINE}_privatekey.pem
mv ${MACHINE}_* /etc/
Personal tools