jump to navigation

Google Authenticator without a phone March 20, 2013

Posted by Rich in linux.

I’m a fan of Google Authenticator and have it enabled for my Google accounts and use the Android app. However, I have downgraded phones temporarily and no longer have access to my Android phone. But I don’t want to disable Google Authenticator on my accounts just because my phone can’t run a GAuth client.

So I decided to use a desktop client instead. The wikipedia page has some clients, and this simple Java one looks like it will be good for my needs. I haven’t tried it yet, but in order for it to work, it needs my secret key. I could regenerate a new one, but where’s the fun in that?

Although I don’t have my Android phone, I have the SD card and a nandroid backup. From this backup, I can recover the secret key. I followed this very helpful blog post, and here are the commands I used:

  1. Mount the sdcard: pmount /dev/mmcblk0p1
  2. Extract the data directory for Google Authenticator into my current directory: tar xf /media/mmcblk0p1/clockworkmod/backup/2013-03- data/data/com.google.android.apps.authenticator2/
  3. Change to the app’s databases directory: cd data/data/com.google.android.apps.authenticator2/databases/
  4. Open up the sqlite database: sqlite3 ./databases
  5. Display the account information:sqlite> select * from accounts;

And there is my secret key, after the email address as a BASE32-encoded 16-character string. (Names and keys have been changed to protect the innocent.)



No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: