Skip to content

Latest commit

 

History

History
66 lines (37 loc) · 1.57 KB

github.md

File metadata and controls

66 lines (37 loc) · 1.57 KB

GitHub MFA and tricks


To enable GitHub MFA visit:

https://github.com/settings/security

Don't forget to save securely your recovery codes

Using git with ssh

$ git clone [email protected]:FernandoMiguel/MFAguide.git

asks for sshkey password, unless key is unlocked

Which can be achieved with:

$ ssh-add ~/.ssh/ed25519

Enter passphrase for /Users/fernando/.ssh/ed25519:

GitHub sshkeys

You should keep your public sshkeys updated on GitHub

https://GitHub.com/settings/keys

You can see your keys at https://GitHub.com/YOUR-USERNAME.keys

Example: https://GitHub.com/fernandomiguel.keys

Generate a sshkey pair

$ ssh-keygen -t ed25519

Always set a password


Using git with https

$ git clone https://GitHub.com/FernandoMiguel/MFAguide.git

asks for your GitHub username and a 'password'.

But since you now have MFA enabled, your web password no longer works.

Instead you must use a Personal access tokens

You can securely store that token in your keychain.

HTTPS vs ssh

Personally I opt to use https methods, since I don't like having my sshkey unlocked.

By using https methods, code editors can more easilly interact with git repos.