Skip to content

Instantly share code, notes, and snippets.

@Ewen2015
Created February 23, 2024 08:27
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 Ewen2015/4802d087f755609136efa9fe832b5c9a to your computer and use it in GitHub Desktop.
Save Ewen2015/4802d087f755609136efa9fe832b5c9a to your computer and use it in GitHub Desktop.
Generating a new SSH key and adding it to the ssh-agent
function generate_ssh_key () {
read -p "Enter github email : " email
echo "Using email $email"
ssh-keygen -t ed25519 -C "$email"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
pub=`cat ~/.ssh/id_ed25519.pub`
echo "$pub"
}
generate_ssh_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment