I am reading through a book that had me generate an SSH key and add it to GitHub. After doing so, the book simply states that we are ready to create a repository and push our code up. I am confused because I have never needed to do this to push up my code. So what purpose does this serve?
Keys are basically decoupled passwords. Typically, there is a one-to-one mapping between passwords and accounts: each account has exactly one password, and each password is (or rather, should be) used with exactly one account.
However, any number of keys can be associated with a single account. This means you can have a different way of authenticating yourself from your personal computer, your work computer, your phone, your tablet, etc. If any one of those keys gets compromised, you can invalidate it without affecting the others.
This also allows for more secure account sharing: multiple maintainers can each have their own key for contributing to a shared repository.
The ssh key generated lets github verify you are the one pushing code and not someone else who might be malicious or otherwise. They are less cumbersome and more secure than manually entering a username/password as well. I'm not sure how you previously used github but SSH keys are best practice way to secure your repo so I would recommend you continue to use this key in the future.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With