Skip to content

Instantly share code, notes, and snippets.

@nikhiljohn10
Last active August 4, 2022 06:05
Show Gist options
  • Select an option

  • Save nikhiljohn10/d362a50f1968c455c073e2d2dc92c5d2 to your computer and use it in GitHub Desktop.

Select an option

Save nikhiljohn10/d362a50f1968c455c073e2d2dc92c5d2 to your computer and use it in GitHub Desktop.
Github SSH Key Generation
[[ "$1" == "" ]] && echo "Please give email id as argument" && exit
ssh-keygen -t ed25519 -C "$1"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
echo "Your Public SSH Key is:"
cat ssh-add ~/.ssh/id_ed25519.pub
git config --global user.email "$1"
echo
echo "Run following to config git:"
echo " git config --global user.name \"Your Name\""
@nikhiljohn10
Copy link
Author

Example:
(Replace hello@example.com with your email id)

wget https://gist.githubusercontent.com/nikhiljohn10/d362a50f1968c455c073e2d2dc92c5d2/raw/2e8e694cb0bc2ff38cfd8fa53f9ecfdf1b5f144c/ssh-setup.sh
bash ssh-setup.sh hello@examle.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment