# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hemantajax-2.gitbook.io/git-step-by-step/ssh-key.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
