Git and GitHub are essential tools for every developer. They are widely used in almost all types of software development projects.
There are other Git hosting services like Gitlab and Bitbucket , but GitHub is the most popular choice for developers. You can even edit your profile to make it look more attractive to recruiters.
You can use Git and GitHub to organize your projects, collaborate with other developers, and of course, at Kinsta .
But because Git and GitHub are related but different tools , you have to update your workflow with each of them constantly.
We recommend that you use SSH keys for each of your machines. So, in this tutorial, you’ll learn what they are, some of their advantages, and how to generate and configure GitHub SSH keys.
Let’s get started!
What are SSH keys?
Simply put, SSH keys are credentials used for the SSH (Secure Shell) protocol to allow secure access to remote computers over the Internet. Typically, that authentication occurs in a command-line environment.
This protocol is based on a client-server overseas chinese in worldwide data architecture, meaning that you, as a user (or “client”), have to use special software, called an SSH client, to log into a remote server and run commands. This is basically what you do when you authenticate via a terminal on GitHub.
But SSH isn’t just used for GitHub. It’s widely used by other platforms like Kinsta, Google Cloud, and Amazon Web Services to create a secure channel to access their services.
Now, getting into how SSH keys actually a rich program packed with information work, you need to understand the differences between public and private keys.
Public and private keys
Let’s start with the basics.
The SSH protocol uses a cryptography fax list technique called asymmetric encryption . This term may sound complicated and strange, but nothing could be further from the truth.
Basically, asymmetric encryption is a How to Generate system that uses a pair of keys, namely the public and private keys .
As you might guess, the public key can be shared with anyone. Its main purpose is to encrypt data, turning the message into a secret code or ciphertext. This key is usually sent to other systems – for example, servers – to encrypt the data before it is sent over the Internet.
On the other hand, the private key is the one you should keep for yourself. It is used to decrypt the data encrypted with your public key. Without it, it is impossible to decrypt your encrypted information.
This method allows you and the server to maintain a secure communication channel to transmit information.
Here’s what happens in the background when you connect to a server using SSH:
- The client sends the public key to the server.
- The server asks the client to sign a random message encrypted with the public key using the private key.
- The client signs the message How to Generateand sends the result to the server.
- A secure connection is established between the client and the server.
It is important to keep your private keys safe and not share them with anyone under any circumstances. They are literally the key to all information sent to you.
Using SSH Keys with GitHub
As of August 13th, 2021, Github no longer supports password authentication for command line access. This means you now have to authenticate via a personal access token or use a slightly more convenient SSH key.