About Beckman

I'm a big geek, serial entrepreneur and idea guy. I've been called names, such as PHP Guru, MySQL DBA, BOFH, Security God, etc. That and Peter-Peter-Pumpkin-Eater.

The image in the header is © Peter Beckman.

Archives

01 Jan - 31 Jan 2003
01 Feb - 28 Feb 2003
01 Mar - 31 Mar 2003
01 Apr - 30 Apr 2003
01 May - 31 May 2003
01 Jun - 30 Jun 2003
01 Jul - 31 Jul 2003
01 Aug - 31 Aug 2003
01 Sep - 30 Sep 2003
01 Oct - 31 Oct 2003
01 Feb - 28 Feb 2004
01 Jul - 31 Jul 2004
01 Aug - 31 Aug 2004
01 Oct - 31 Oct 2004
01 Mar - 31 Mar 2005
01 Apr - 30 Apr 2005
01 May - 31 May 2005
01 Jun - 30 Jun 2005
01 Jan - 31 Jan 2006
01 Jun - 30 Jun 2006
01 Feb - 28 Feb 2007
01 Apr - 30 Apr 2007
01 Sep - 30 Sep 2007
01 Mar - 31 Mar 2008
01 May - 31 May 2008
01 Jul - 31 Jul 2013
01 Sep - 30 Sep 2013
01 Apr - 30 Apr 2014
01 Jul - 31 Jul 2014
01 Dec - 31 Dec 2014
01 Dec - 31 Dec 2015

Links

AngryOx.com
Tossable Digits - Cheap, Anonymous, Disposable Phone Numbers
The Internet License Plate Database
Love & Onions (Jen, my wife)
Roadie Speaks Blog
BananaForce
AdCritic.com
Slashdot
I Love Ben Brown

Search!

Last Comments

Denny (A hybrid enclosed…): ohh..it looks damn intere…
Mellanni Coupons (A hybrid enclosed…): yeah… I want one that hyb…
Download SAP Prac… (Centrum Silver Ad…): Thank you very much for t…
Help With Enginee… (Wow, I'm fat.): I Personally Like Your Po…
Case Solution (Wow, I'm fat.): Hi Buddy, Your Blog’ S De…
Root Protection (This computer can…): I am facing the same situ…
moon (This computer can…): This is amazing thanks to…
resume service on… (3 Reasons to Dist…): It’s really hard to trust…
happy car rides (Under-Cabinet/Und…): USA can I observe this ca…
Best Dissertation… (Centrum Silver Ad…): I am really excited about…

Stuff

Powered by Pivot - 1.40.1: 'Dreadwind' 
XML: RSS Feed 
XML: Atom Feed 

« Renaming your OSX Hom… | Home | How to log cron jobs … »

Quicksilver and OTP: Together At Last

Monday 15 December 2014 at 11:57 pm

I’ve been using Two-Factor Authentication on most every site that supports it for a while now: Google, Evernote, Facebook and Dropbox to name a few. But I’ve always grumbled when I’m on my laptop and I need to log into one of these accounts and they are asking for my TFA token.

Now I’ve got it working where I can get the latest token for any of these services on my Mac in Quicksilver and copied to my clipboard in no time flat. You can have it working for yourself in just a few minutes.

First off, requirements:

Once you’ve installed everything, put this code in a file named “otp” in your ~/bin/ folder and make sure it is in your path.

#!/bin/bash
scriptname=`basename $0`
if [ -z $1 ]
then echo “$scriptname: Service Name Req’d” echo “” echo “Usage:” echo “ otp google” echo “” echo “Configuration: $HOME/.otpkeys” echo “Format: name=key” exit
fi
otpkey=` grep $1 $HOME/.otpkeys | cut -d”=” -f 2 | sed “s/ //g” `
if [ -z $otpkey ]
then echo “$scriptname: Bad Service Name” exit
fi
/usr/local/bin/oathtool —totp -b $otpkey

Now you need to put your special keys (you kept them handy and encrypted somewhere, right?) into a special, you-read-only file in your home dir named .otpkeys. Make sure you chmod 600 .otpkeys so nobody can snoop ‘em! Here’s what it should look like:

google=a743 mike k3b4 rm5k z8a9 q6f5 id1k bxk1 facebook=OWBV Q9LF POQ2 MKYU evernote=UKPPIDEALLKPYTT9 dropbox=iop4 xbox asia b0ss ninj a9

It isn’t the most secure implementation but it gets the job done. I considered putting the keys/config into a Keychain item and use /usr/bin/security to access them, maybe more securely.

Now run it!

Quicksilver OTP Command

And the result.

Quicksilver OTP Result

Enjoy!


three comments

Watch the curly quotes in the code above. You need to get straight quote marks (watch the sed line) and also convert em-dashes into double – marks.
helpful-person - 07 10 15 - 11:47

I visit this blog first time and inspire by this good stuff work. Incredible post keeps up posting such great information. If you like to write essays then you can use custom essay writing service for a trust worthy service.
custom essay writing service (Email) (URL) - 21 01 17 - 04:55

Hi,

I saw your idea on SuperUser and liked it so much. I did a small improvement, added the GPG encryption:
https://github.com/apiraino/otp-cli-tool

Thank you for the cool idea!
Antonio - 10 08 17 - 09:40


August 2017 Xbox Live Games with Gold: Slime Rancher, Trials Fusion, Bayonetta and Red Faction: Armageddon
Microsoft is now officially announced August’s 2017 Games with Xbox Live Gold, includes: Slime Rancher, Trails Fusion, Bayonetta and Red Faction: Armageddon, provides over $89 dollars in value and up to 4000 gamerscore. Both Bayonetta and Red Fac…
Sent on 27 07 17 - 02:37 , via PUPUWEB

Trackback link:

Please enable javascript to generate a trackback url

  
Remember personal info?

Emoticons / Textile

To prevent automated comment-spam, we require you to answer this silly question.
 

  (Register your username / Log in)

Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.