Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. STORAGE_LOCATION=~/.ssh
  2. ROUNDS=250
  3. ALGOS=(RSA RSA ECDSA ECDSA ECDSA ED25519 )
  4. SIZES=(2048 4096 256 384 521 256 )
  5.  
  6. echo "Enter the email you want to generate keys with and press [ENTER]: "
  7. read EMAIL
  8. echo "Enter the password you want to secure the keys with and press [ENTER] (empty for no password): "
  9. read -s PASSWORD
  10.  
  11. for i in "${!ALGOS[@]}"; do
  12. ALGO="${ALGOS[$i]}"
  13. SIZE="${SIZES[$i]}"
  14. echo "Generating ${ALGO}-${SIZE} key..."
  15. FINGERPRINT=$(ssh-keygen -t "${ALGO}" -b "${SIZE}" -C "${EMAIL}" -N "${PASSWORD}" -o -a "${ROUNDS}" -f "${STORAGE_LOCATION}/${EMAIL}.${ALGO}-${SIZE}" | grep "SHA256:")
  16. echo "Key Fingerprint: ${FINGERPRINT}"
  17. done
  18.  
  19. echo "Done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement