Created
April 2, 2021 23:10
-
-
Save nikonovak/756c2bb7ddee1fe7341e5e96599aa1e4 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
printf "\n\n\nLet's generate a key for you...\n----------------------------------------\n" | |
read -p 'Please enter your e-mail address: ' email | |
printf "\nYou entered ${GREEN}$email${NC}\n" | |
read -p "Is this correct? [y/N] " -n 1 -r | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
mkdir -p ~/.ssh && ssh-keygen -t ed25519 -f ~/.ssh/og_bastion -N '' -q -C $email <<< n > /dev/null | |
printf "\nYour public key is:\n${GREEN}" | |
cat ~/.ssh/og_bastion.pub | |
cat ~/.ssh/og_bastion.pub | pbcopy && \ | |
printf "\n${NC}We copied it for you to the clipboard\n\nPlease navigate to: ${GREEN}<link>${NC} and paste it to the <field> field\n" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment