Skip to content

Instantly share code, notes, and snippets.

@thiagopbueno
Last active August 28, 2019 14:47
Show Gist options
  • Save thiagopbueno/f45de770f1827415f1c2d319c92432c3 to your computer and use it in GitHub Desktop.
Save thiagopbueno/f45de770f1827415f1c2d319c92432c3 to your computer and use it in GitHub Desktop.
SSH key in GitHub

Connecting to GitHub with SSH

https://help.github.com/en/articles/connecting-to-github-with-ssh

Online Password and Passphrase generator

https://www.ssh.com/iam/password/generator

Accessing (Pushing to) Github without username and password

https://medium.com/@amanze.ogbonna/accessing-pushing-to-github-without-username-and-password-3022feb077fb

# list existing keys
$ ls -la ~/.ssh/

# in case you need to generate a new key
$ ssh-keygen -t rsa -b 4096 -C <email>

# start ssh-agent
$ eval "$(ssh-agent -s)"

# add key to agent
$ ssh-add ~/.ssh/id_rsa

# copy the public key
$ xclip -sel clip ~/.ssh/id_rsa.pub

# add public key to GitHub settings
# https://github.com/settings/keys

# test SSH connection
$ ssh -T [email protected]

# list fingerprints of all identitie
$ ssh-add -l

# set origin remote to ssh url in your local repo
$ git remote set-url origin [email protected]:<user>/<repo>.git

# check origin remote url
$ git remote -v
origin	[email protected]:<user>/<repo>.git (fetch)
origin	[email protected]:<user>/<repo>.git (push)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment