setting up ssh keys for github and bitbucket
26 May 2022


Generating a new SSH key for Github
01echo "Generating a new SSH key for Github (private)"02ssh-keygen -t ed25519 -C "<insert email>" -f ~/.ssh/daren_github_private03eval "$(ssh-agent -s)"04touch ~/.ssh/config05printf "# Default hostname\n Host github.com\n Hostname github.com\n AddKeysToAgent yes\n UseKeychain yes\n IdentityFile ~/.ssh/daren_github_private" | tee ~/.ssh/config06ssh-add -K ~/.ssh/daren_github_private07echo "run 'pbcopy < ~/.ssh/daren_github_private.pub' and paste that into Github"typescript
If you use a new host or something like `bitbucket.org-clientname` as `host`. You need to add it to your ssh.
ssh -T git@bitbucket.org-clientname