HTTP vs SSH - muneeb-mbytes/computerArchitectureCourse GitHub Wiki

SL No Contents
1 Introduction
2 Steps to generate an SSH key pair
3 Converting HTTPS link to an SSH link

Introduction

Difference between HTTP, HTTPS and SSH links

HTTP: Stands for Hypertext Transfer Protocol. That isn't safe. Since information delivered over HTTP is sent in plain text, hackers can intercept and alter it.

HTTPS: Stands for Hypertext Transfer Protocol Secure. All communications between the user's browser and the website are encrypted if a URL loads using the HTTPS protocol.

image

For more information: All about links

SSH: Stands for Secure Shell. Provides encryption for data in transit and also includes authentication for both the client and the server. Used for secure remote access to servers (SSH login)

SSH Keys in GitHub

Need for SSH Keys

You'll frequently need to authenticate yourself to GitHub using your username and password while interacting with a GitHub repository. An SSH key is a backup identity that you can use instead of constantly entering your password and username.

SSH keys are saved in pairs: a private key that is kept on your computer alone and a public key that is shared with services like GitHub. As long as the keys match, you get in.

Nobody will be able to reverse engineer your private key from the public one thanks to the cryptography used in SSH keys.

Steps to generate an SSH key pair

Step1: Navigate to GitHub settings

image

Step2: Click on SSH and GPG keys

image (1)

Step3: Click New SSH key, it will open a window asking key title and the key

image

Step4: Now open your terminal paste the below command

          ssh-keygen -t ed25519 -C "[email protected]"

Screenshot from 2024-01-16 12-37-43

Step5: It will ask for the file where the key needs to be stored, if we click enter then it will take a default location

Screenshot from 2024-01-16 12-40-40

Step6: Click enter twice Screenshot from 2024-01-16 12-40-51

Step7: In this step the public and private key will be generated and it will show you the location where it is stored. Screenshot from 2024-01-16 12-41-14

Step8: We can navigate to that path and find the public and private key in our system. Open the file ***.pub and copy the public key generated Screenshot from 2024-01-16 12-49-01

Step9: Paste the public key in the GitHub window and give a key title Screenshot from 2024-01-16 12-48-43

Step10: We are done and ready to go! Screenshot from 2024-01-16 12-49-57