Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- STORAGE_LOCATION=~/.ssh
- ROUNDS=250
- ALGOS=(RSA RSA ECDSA ECDSA ECDSA ED25519 )
- SIZES=(2048 4096 256 384 521 256 )
- echo "Enter the email you want to generate keys with and press [ENTER]: "
- read EMAIL
- echo "Enter the password you want to secure the keys with and press [ENTER] (empty for no password): "
- read -s PASSWORD
- for i in "${!ALGOS[@]}"; do
- ALGO="${ALGOS[$i]}"
- SIZE="${SIZES[$i]}"
- echo "Generating ${ALGO}-${SIZE} key..."
- FINGERPRINT=$(ssh-keygen -t "${ALGO}" -b "${SIZE}" -C "${EMAIL}" -N "${PASSWORD}" -o -a "${ROUNDS}" -f "${STORAGE_LOCATION}/${EMAIL}.${ALGO}-${SIZE}" | grep "SHA256:")
- echo "Key Fingerprint: ${FINGERPRINT}"
- done
- echo "Done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement