Generate SSH Key in your server
ssh-keygen -t ed25519 -C "[email]" -f ~/.ssh/[name]
Copy the key in the .pub
file and paste it in your gh access tokens
$ cat ~/.ssh/id_ed25519.pub
# Then select and copy the contents of the id_ed25519.pub file
# displayed in the terminal to your clipboard
If your ssh is not being read and fails to perform any git operations due to permissions
# Check if your key is listed
ssh-add -l
# If not, add your key
ssh-add ~/.ssh/id_rsa
# If facing an error "Count not open a connection to your authentication agent."
eval `ssh-agent -s`
Add config file in ~/.ssh/config
Here's a sample content
# KarmaBlackshaw
Host github-personal
HostName github.com
User git
IdentityFile ~/.ssh/karmablackshaw
# OutliantJeash
Host github-outliant
HostName github.com
User git
IdentityFile ~/.ssh/outliant
Remember, when cloning from a specific account, change the host address
# from
[email protected]:ByWinona/admin-dashboard-next.git
# to
git@github-outliant:ByWinona/admin-dashboard-next.git
Similar content
https://gist.github.com/rahularity/86da20fe3858e6b311de068201d279e3