> For the complete documentation index, see [llms.txt](https://hemantajax-2.gitbook.io/git-step-by-step/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hemantajax-2.gitbook.io/git-step-by-step/ssh-key.md).

# SSH Key

// default id\_rsa // private key id\_rsa.pub // public key

```
ls -l ~/.ssh // list out ssh keys if exists

// Generate Key ( 4096 - length, strong )
ssh-keygen -t rsa 4096 -C "key pair demo"
// C://users/hesing/.ssh/
// enter password if you wish or leave blank if don't need password

// In case later you want to add password to already generated key use
ssh-keygen -p

// Add key to ssh agent
eval "$(ssh-agent -S)"
ssh-add ~/.ssh/id_rsa.pub

// Add SSH key to github
clip < ~/.ssh/id_rsa.pub

// Go to github profile -> settings -> SSH keys ( paste it and save )

// Test connection to github
ssh -T -p 443 git@ssh.github.com // have firewall issues etc then use this

// OR ( generally use this)
ssh -T git@github.com
```
