Endpoint Management
Encrypting a Password to Use in Scripts in Jamf Pro
Last modified 7/9/2020
About
This guide will show you to encrypt your passwords to be able to use in parameters for scripts in Jamf Pro.
Getting Started
- On a macOS device, open the Terminal app.
Run the following script block to load the function.
function GenerateEncryptedString() { local STRING="${1}" local SALT=$(openssl rand -hex 8) local K=$(openssl rand -hex 12) local ENCRYPTED=$(echo "${STRING}" | openssl enc -aes256 -a -A -S "${SALT}" -k "${K}") echo "Encrypted String: ${ENCRYPTED}" echo "Salt: ${SALT} | Passphrase: ${K}" }
Run the loaded function with the password you would like to encrypt.
GenerateEncryptedString 'YourPasswordHere'
- You can take the outputted Encrypted String, Salt, and Password and use in the scripts parameters in Jamf Pro.
For more information visit - https://github.com/jamf/Encrypted-Script-Parameters