The other day I wrote that I were looking at LastPass alternatives. At that time I had given KeyPass a shot, but now I have had time to try pass and its Firefox extension passff. Compared to LastPass and KeyPass, it's an extremely lightweight setup, which I really like.
Exporting your passwords from LastPass is very easy:
- Visit https://lastpass.com/?&ac=1.
- Expand Tools in the left sidebar.
- Expand Advanced tools.
- Select Export.
- A new window opens with your passwords as a .csv table.
- Hit Ctrl+S to save it to your HDD.
I know that there's a Ruby script for importing LastPass passwords into pass. However, I got an error when I tried to run it and I'm not fluent with Ruby. So rather than trying to understand the script, I wrote a short Python script that goes through the password list and imports them into pass according to my own preferences:
Run it in the following way:
$ chmod u+x lastpass2pass.py $ ./lastpass2pass.py my_passwords.csv
And they are now imported into pass!
Note, I have only written the script for my own needs on my own machine. I recommend you to go through the imported passwords to verify that they look as you expect. For example, count them (use pass | wc -l to get a rough count), check the passwords' metadata if it's all there, check Unicode characters, check special characters in your passwords, etc. I don't guarantee anything, so I recommend you to read through the script and tweak it to your own taste.
Installing pass on Fedora is super easy:
$ sudo dnf install pass
What took me some time to figure out is that pass relies on gpg2, and not gpg. So you will need to create a key with gpg2 --gen-key. Then get the key's ID:
$ gpg2 --list-keys /home/matachi/.gnupg/pubring.kbx -------------------------------- pub rsa2048/79474561 2015-10-18 uid [ultimate] My name <firstname.lastname@example.org> sub rsa2048/C623D74B 2015-10-18
And init pass with the key ID:
$ pass init 79474561