github and two factor authentication

Main menu:

Topics

Recent Posts

Blog

April 2014
M T W T F S S
« Mar   May »
 123456
78910111213
14151617181920
21222324252627
282930  

Past Posts

Java/Java EE

JDBC

Other

github and two factor authentication

April 12th, 2014 by Jeanne Boyarsky

Two years ago, I set up two factor authentication for my gmail account.  Last year, github announced the ability of two factor.  I hadn’t noticed at the time.  Today, I logged on to change my password since github was in the list of applications affected by Heartbleed and saw the option.

How it works

Github gives you a choice of second factor

  • Google Authenticator mobile application (I already had the iPad app installed for gmail so this was convenient)
  • text to mobile phone (I have this set a secondary)
  • written down one time use passwords (kept as tertiary)

Linking the mobile app to github

  1. Open the mobile app
  2. Click “edit” pencil
  3. Click “+” to add an account.
  4. On your computer, go to your github account settings and click to enable two factory.  You will be given a QR code to scan which automatically links the two.  There is also  the option of typing in a long text code.

That’s it.  Now Google Authenticator generates two numeric codes.  One for gmail and one for github.

Actually using two factor

Unlike gmail, you probably don’t usually sign on two github using the browser.  Let’s look at three ways of signing in.

Through the browser

  1. I immediately logged out in the browser.
  2. Enter my password to sign back in
  3. Enter my two factor code

Through the github Mac app

  1. Github > Github preferences
  2. Click sign out
  3. Enter my username/password to sign back in
  4. Enter my two factor code

Through the command line

  1. On the account settings page, create a new personal token
  2. Leave the default privileges checked.  (It’s great there is this much control)
  3. git credential-osxkeychain erase
  4. git pull   (or any other operation that requires a network call to github)
  5. Enter your user id
  6. Enter your new generated token (not your password)

Current apps

As you might expect, the account settings page shows which apps have access.  I saw “GitHub for Mac” and “GitHub for Windows” on there.  My first thought was “I don’t use Windows.”  Then I remembered that I use git to communicate between my Mac and Windows VM.

Github references

Web service

I also had to update my web service code to call the two factor version.

Action items

If you haven’t already, please change your passwords for sites in this list or enabling two factor will protect you in the future.  Also change your passwords for any sites which use the same password as one of those in the list.

Comments

Pingback from enabling more two factor – dropbox, linked in, twitter and yahoo | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky
Posted: April 12, 2014 at 10:13 am

[…] github and two factor authentication […]

Pingback from enabling more two factor – dropbox, linked in and yahoo | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky
Posted: April 12, 2014 at 10:16 am

[…] github and two factor authentication […]

Write a comment