As of August 13, 2021 __[GitHub|http://github.com/]__ will stop supporting username-password authentication as a means of checking files into their repository. Reading from a github repository doesn't require logging in (e.g., "git clone") so that will continue to work, but support for writing back to github without a more secure authentication method will end. This page contains notes on how I set up SSH keys to push and pull from my account on github. It's ''generally recommended'' that you read and follow their documentation (see the first link below) about how to set up either "personal access tokens" or SSH keys. These are __my notes__ about how I did it; I learned how from the github documentation. !! Steps ! Generating a New SSH Key Generate an SSH key using the Ed25519 algorithm: {{{ $ ssh-keygen -t ed25519 -C "your_email@example.com" }}} This creates a new ssh key named "id_ed25519", located in the {{~/.ssh/}} directory), using the provided email as a label. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location. At the prompt, type a secure passphrase. For more information, see ["Working with SSH key passphrases"|https://docs.github.com/en/articles/working-with-ssh-key-passphrases]. ! Adding the SSH Key to the ssh-agent Start the ssh-agent in the background. If you're using bash shell: {{{ $ eval "$(ssh-agent -s)" Agent pid 59566 }}} or csh/tcsh: {{{ % eval `ssh-agent` Agent pid 59566 }}} Then add your SSH private key to the ssh-agent: {{{ $ ssh-add ~/.ssh/id_ed25519 }}} Now check that you can authenticate with github: {{{ $ ssh -T git@github.com Hi [username]! You've successfully authenticated, but GitHub does not provide shell access. }}} If things are working you'll see the above message. ! Try it Out From within a git-managed directory, make sure you're using the {{git:}} protocol rather than {{http:} to connect to git: {{{ % git remote -v origin git@github.com:[username]/[path] (fetch) origin git@github.com:[username]/[path] (push) }}} If you see an http: protocol you should change the connection URL using: {{{ % git remote set-url origin git@github.com:[username]/[repository-path].git }}} If all is configured correctly you should be able to do a {{git push}} without being asked for your username and password. !! Links * __[Connecting to GitHub with SSH|https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh]__ * [Adding a new SSH key to your GitHub account|https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account] * [GitHub: Basic Authentication Deprecation Notice|https://help.pluralsight.com/help/github-basic-authentication-deprecation-notice] * [Token authentication requirements for Git operations|https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/] ---- [{Tag Recipe}]