2-factor authentication for GitHub


#1

I had the GitHub integration working nicely, but then was required by my employer to turn on 2-factor authentication, and now cannot get in through Atom. Any suggestions on how to do this?

Checked, and this did not affect my home machine – just work. The two are set up very similarly - the only major difference is that the work machine has some kind of drive-wide file encryption.


#2

When you say “cannot get in through Atom”, do you mean that you can no longer pull/push with your repositories?

If so, with 2FA enabled you need to use a personal access token instead of your password for Git operations:

https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/

Are you prompted for credentials on your work machine?


#3

Right – I had been working on the machine all morning, making pulls and pushes as usual. Then when I turned on 2-factor authentication, went back to Atom, tried to push something, I was prompted for GitHub credentials (which never happens), entered them, and got an error. I was still able to do the push through another client without a problem.

No issue on my other machine.


#4

I was prompted for GitHub credentials (which never happens), entered them

Did you enter a personal access token or your password? If you used your password, can you try with a token?

and got an error. I was still able to do the push through another client without a problem.

Hmm one possibility is that you use SSH instead of HTTPS in the other client? If you use SSH, it doesn’t matter if you have 2FA enabled or not. If you use HTTPS and have 2FA enabled, you have to use a personal access token.


#5

thanks, I’ll try with a token – and thanks again, all set