Skip to content

Instantly share code, notes, and snippets.

@0xjuanma
Created November 23, 2025 15:24
Show Gist options
  • Select an option

  • Save 0xjuanma/1a07ca535def6afb175a88078752b11e to your computer and use it in GitHub Desktop.

Select an option

Save 0xjuanma/1a07ca535def6afb175a88078752b11e to your computer and use it in GitHub Desktop.
ssh-key-generate
#!/bin/bash
[[ -f ~/.ssh/id_ed25519 ]] && echo "SSH key already exists at ~/.ssh/id_ed25519. Aborting." && exit 1
read -p "Email: " email
ssh-keygen -t ed25519 -C "$email"
eval "$(ssh-agent -s)"
[[ "$OSTYPE" == "darwin"* ]] && ssh-add --apple-use-keychain ~/.ssh/id_ed25519 || ssh-add ~/.ssh/id_ed25519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment