Easy password generating under OS X

I generate a loooot of passwords. I try out a lot of webservices and all those needs passwords. I control about 70-100 servers and all those have different services and accounts. So I generate a lot of passwords… and this post is about how I do it do make it as easy as possible.

Using pwgen out-of-the-box

I use pwgen (http://sourceforge.net/projects/pwgen/) to generate my passwords. pwgen can be downloaded from sourceforge or installed from MacPorts.

I used to have an alias that looked something like this

alias pwgen='pwgen 15'

This command will generate a screen of passwords and I the use the mouse to double click on some random password. This have been great but requires me to move my hand to the mouse which is time consuming.

Getting rid of the mouse

So to get rid of the mouse I have created this alias which generates one password and the copies the password to the clipboard.

alias pwgen="pwgen -N1 -s 15 | tr -d '\n' | pbcopy ; echo 'Password copied to clipboard.'"

So my workflow becomes something like shift focus to Terminal with ⌘ + Tab and then create a new window with ⌘ + N.
Write pwgen and then close the window with ⌘ + W and then I am back where I started with a fresh password in my clipboard.


Posted in Mouseless, Operatingsystem at January 13th, 2009. Trackback URI: trackback Tags: , , Written by: 
  • http://marcus.ahnve.net Marcus Ahnve

    So where do you store them?

  • Mathias Stjernstr√∂m

    I store them in Keychain. I have tried thousands of password programs both on Windows an OS X and the best one I have tries so far is Keychain in combination with Quicksilver. But when I got the news that quicksilver where not supported anymore I created my own keychain front-end (http://www.stjernstrom.se/projects/keyfinder/).

    This is pretty much my setup.

    Keychain is the storage container and I use these frontends/program.

    For web services (safari): 1Password.
    For SSH: SSHKeychain (I only use keys for my login users).
    For su/sudo everything thats not safari: keyFinder

It's past my bedtime is using WP-Gravatar