# SSH Keys Generation
### Checking for existing SSH keys first
```TXT
ls -al ~/.ssh
```
### Generating a new SSH key
```TXT
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
```
### Adding your SSH key to the ssh-agent
```TXT
eval "$(ssh-agent -s)"
```
### Add your SSH private key to the ssh-agent and store your passphrase in the keychain
```TXT
ssh-add -K ~/.ssh/id_rsa
```
### Adding a new SSH key to your GitHub account
```TXT
pbcopy < ~/.ssh/id_rsa.pub
```
### If it doesn’t work (do not copy it) use:
```TXT
cat git_rsa.pub
```
This will list the key, then just copy it and paste into the deploy key on the GitHub repo
## Modify existing SSH
### CD into .ssh
```TXT
cd ~/.ssh
```
```TXT
ls -la
```
```TXT
vim known_hosts
```
Then change the credentials if necessary and save it