![]() |
An SSH (Secure Shell) key is a pair of cryptographic keys used for authenticating and securing network communications over the SSH protocol. SSH keys are commonly used to securely access remote systems, transfer files, and execute commands on remote machines without passwords. Components of an SSH KeyPrivate Key:
Public Key:
Now let’s start by generating an SSH key to be used in our Github account: Step 1: Generate a New SSH KeyIf you don’t already have an SSH key, you’ll need to generate one. If you already have one, you can skip to Step 2.
ssh-keygen -t ed25519 -C "[email protected]"
ssh-keygen -t rsa -b 4096 -C "[email protected]"
Replace “[email protected]” with your GitHub email address. Follow the prompts:
![]() generating ssh-key Note: It is asking for overwrite because i have already generated a ssh key earlier. Step 2: Start the SSH Agent
Start-Service ssh-agent
ssh-add ~/.ssh/id_ed25519
ssh-add ~/.ssh/id_rsa
![]() starting ssh service Started the ssh-agent and added the private key. Step 3: Add the SSH Key to Your GitHub Account
cat ~/.ssh/id_ed25519.pub
If you used RSA: cat ~/.ssh/id_rsa.pub
Log in to your GitHub account. Navigate to SSH and GPG keys settings:
![]() github option to add SSH keys Add a new SSH key:
![]() ssh key is added to github accou Confirm your GitHub password to complete the process. ![]() Successfully added ssh key: Step 4: Test Your SSH Connection
ssh -T [email protected]
You might see a warning the first time you connect: The authenticity of host 'github.com (IP ADDRESS)' can't be established. Type yes to continue.
If everything is set up correctly, you should see a message like: Hi username! You've successfully authenticated, but GitHub does not provide shell access
You’ve successfully added an SSH key to your GitHub account. ![]() Successfully added ssh fingerprint Now you can clone repositories, push changes, and perform other Git operations over SSH without needing to enter your password each time. |
Reffered: https://www.geeksforgeeks.org
Git |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 17 |