-
-
Save ashayh/6276080098112d36848ea1cb576ab376 to your computer and use it in GitHub Desktop.
Jenkins key generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Generate master.key and secret | |
MAGIC="::::MAGIC::::" | |
mkdir -p /var/jenkins_home/secrets | |
openssl rand -hex 128 > /var/jenkins_home/secrets/master.key | |
openssl dgst -sha256 -binary /var/jenkins_home/secrets/master.key > /tmp/master.hashed | |
HEX_MASTER_KEY=`head -c 16 /tmp/master.hashed | xxd -l 16 -p` | |
openssl rand 259 > /tmp/base | |
echo $MAGIC >> /tmp/base | |
openssl enc -aes-128-ecb -in /tmp/base -K $HEX_MASTER_KEY -out /var/jenkins_home/secrets/hudson.util.Secret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment