from my new machine, wanted to checkout my existing github repo and start making commits.
how do I do connect to it via SSH?
for ssh we would need a private and public key pair,
private key we keep, and public key we let github know.
lets do this
setting this up on ubuntu / linux
- assuming no existing key is present // generate ssh keypair
$ ssh-keygen -t ed25519 -C "your_email@example.com or username"
- add private key to ssh-agent // why??
$ ssh-add ~/.ssh/id_ed25519
- copy public key and add to github account (settings>access>ssh keys)
public key details is here
$ cat ~/.ssh/id_ed25519.pub
# Then select and copy the contents of the id_ed25519.pub file
# displayed in the terminal to your clipboard
- test ssh connection from terminal
$ ssh -T git@github.com
Ref : https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh
Top comments (0)