Skip to content

Instantly share code, notes, and snippets.

@nikonovak
Created April 2, 2021 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikonovak/756c2bb7ddee1fe7341e5e96599aa1e4 to your computer and use it in GitHub Desktop.
Save nikonovak/756c2bb7ddee1fe7341e5e96599aa1e4 to your computer and use it in GitHub Desktop.
#!/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