How to configure pwsafe properly in Ubuntu Maverick Meerkat

pwsafe is a command line application that stores safely your passwords on an encrypted database located at your $HOMEDIR/.pwsafe.dat file. It also suggests random passwords for you to use, and it’s perfect to store all your passwords at home and retrieve them using an ssh connection to your personal machine if you need it.

When you install pwsafe on Ubuntu Maverick Meerkat, you need to do a couple of tweaks in order to use the application without these annoying warnings:

WARNING: pwsafe unable to seed rng from /home/pressure/.rnd
WARNING: pwsafe unable to use secure ram (need to be setuid root)

To get rid of the first warning, you need to populate a $HOMEDIR/.rnd file with random data. A tip you can read on pwsafe man page is to do that based on the /var/log/* files checksum on your machine. So let’s do that with the following command:

md5sum /var/log/* > ~/.rnd

The first time you execute pwsafe, the content of the .rnd file will be used to build a random seed that will help the application to generate any random passwords you ask for.

Concerning the second warning, pwsafe uses a method implemented in the Linux Kernel to secure the memory it needs and impede it to be swapped into the hard disk. Some time ago, such method required to run the commands as root, but that’s not the case anymore.

As explained in the README file of the SUSE package of pwsafe, you should add this two lines to the end of /etc/security/limits.conf

@users soft memlock 5000
@users hard memlock 10000
view raw limits.conf This Gist brought to you by GitHub.

and check that every user that will run pwsafe belongs to the users group. Now log off and log in again with your username and there should not be any warning when you execute the pwsafe command.

And remember that it’s also convenient to make regular backups of your .pwsafe.dat file!

This entry was posted in Code and tagged , , , , , , , . Bookmark the permalink.

Comments are closed.