Hello everyone, in this blog, we are gonna learn something pretty basic connectivity which is required in an Ubuntu (20.04) machine whether it is hosted on AWS, Azure, GCP, your laptop or you are running it in VM or container within your machine.
PS. For cloud solutions, make sure that the outgoing port 22 is open in your security group for your machine.
Shorter Route
If you don't want to read the whole thing just do this:
Hit these commands:
sudo apt-get install git
git config --global user.name "Shameel Uddin"
git config --global user.email "shameel.uddin@ehasabtech.com"
ssh-keygen -t ed25519 -C "shameel.uddin@ehasabtech.com"
ssh-add ~/.ssh/id_ed25519
Add Key to your GitHub
https://github.com/settings/keys
then do this:
ssh -T git@github.com
Longer Route. Moving forward...
Installing Git
Install Git in your machine if it is not already installed.
sudo apt-get install git
Do some basic Git configuration
Configure your username and email.
git config --global user.name "Shameel Uddin"
git config --global user.email "shameel.uddin@ehasabtech.com"
Starting SSH-Agent
eval "$(ssh-agent -s)"
Generate the Key
ssh-keygen -t ed25519 -C "shameel.uddin@hasabtech.com"
This command will ask you where you want to keep it saved. You can keep it to default location which is up to you, it might be better if you don't as anyone would know where they are considering someone gain access to the machine.
Anyways, it further ask for passphrase. Give passphrase and move forward.
For simplicity, I am keeping it to default location with no passphrase.
Add key to SSH Agent
ssh-add ~/.ssh/id_ed25519
Copy your public key
cat ~/.ssh/id_ed25519.pub
Add it to GitHub
Go to this link:
https://github.com/settings/keys
Click on New SSH Key
Add it as Authentication Key. Give Name and the key you copied from last step.
After being added, the page should appear like this:
Check Connectivity:
You can check connectivity like this:
ssh -T git@github.com
Cloning Project
I made a mistake of cloning from HTTPS so please do not make this mistake and clone from SSH as mentioned below =)
It's done 🥳
Thank you for reading!
Follow me here:
LinkedIn: https://www.linkedin.com/in/shameeluddin/
GitHub: https://github.com/Shameel123
Top comments (1)
Doc to use multiple GitHub accounts in single machine:
gist.github.com/rahularity/86da20f...