Skip to content

Instantly share code, notes, and snippets.

@frankdarnese
Last active December 1, 2017 11:27
Show Gist options
  • Save frankdarnese/3a9e7edb28fb9545942321918a9f3a56 to your computer and use it in GitHub Desktop.
Save frankdarnese/3a9e7edb28fb9545942321918a9f3a56 to your computer and use it in GitHub Desktop.
# 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 "[email protected]"
```
### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment