Created
November 23, 2025 15:24
-
-
Save 0xjuanma/1a07ca535def6afb175a88078752b11e to your computer and use it in GitHub Desktop.
ssh-key-generate
This file contains hidden or 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 | |
| [[ -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