Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
CPM is the Console Password Management tool, which allows you to securely store passwords and other key=value pairs in an encrypted XML tree. A single CPM database can be securely used by several people at the same time, see multiuser CPM. CPM passwords can be revision controlled, see revision control.
CPM is adopted here since I've fixed some minor issues of bit rot.
Install from package
Debian & Ubuntu
CPM is part of debian as of the wheezy distribution, and part of Ubuntu from 12.04 and onwards. If you are running wheezy or later, simply install CPM through apt:
me@mine:~# apt-get install cpm
Ubuntu Trusty (14.04)
Ubuntu 14.04 unfortunately has a bad version of CPM (0.28) which doesn't work very well due to bug #129929 (https://bugs.launchpad.net/ubuntu/+source/cpm/+bug/1299229). Use the CPM packages from jessie, these will work: https://packages.debian.org/jessie/cpm
Backport of newer versions of CPM to wheezy for amd64 is available here:
deb http://kid.users.bitbit.net/debian/ wheezy main
To install, download the package and run
# dependencies me@mine:~# apt-get install \ libcdk5 libcrack2 libdotconf1.0 libgpg-error0 \ libgpgme11 libxml2 libxml2-utils libpth20 # installation (replace with package appropriate for your arch and distro) me@mine:~# dpkg -i cpm_0.31-1_i386.deb
See the downloads section for Debian packages at http://github.com/comotion/cpm/downloads
You need: a GPG key and 3 minutes of your time. Create the password database (only once):
Use your GPG key to encrypt the database. This puts a .cpmdb file in your home folder.
Run CPM and add your passwords! Exit by hitting ESC to save the keys.
and you have a working CPM install
For a good read on CPM go to http://kacper.blog.linpro.no/archives/135
If you're sharing your CPM database with others, see revision control.
To avoid the memlock warning on cpm start, add the following to your /etc/security/limits.conf
@cpm - memlock unlimited
Where 'cpm' is a group that your user is a member of. An alternative is to allow all users unlimited memlock, which should be fine on a single-user laptop or desktop.
* - memlock unlimited
After changing this setting, you will need to log out and back in again, or reboot your machine.
The two ways to do this are documented in multiuser CPM.
Doing it by hand
You can do everything the hard way... but most people prefer the "Quick Start" routines outlined above. If you still insist, below is a step-by-step guide to doing most everything manually.
CPM needs cdk, cracklib, dotconf, gpgme, ncurses, gettext and zlib to build.
apt-get install libcdk5 libcdk5-dev \ cracklib-runtime cracklib2 cracklib2-dev \ libdotconf1.0 libdotconf-dev \ libgpgme11 libgpgme11-dev \ libncurses5 libncurses5-dev \ libxml2-dev libxml2-utils \ zlib1g zlib1g-dev gettext
- ./configure --with-crack-dict=/var/cache/cracklib/cracklib_dict make
- make install
CPM must be SUID root to aquire the necessary locks to safely store your passwords. Set up the right bits:
chown root:root /usr/local/bin/cpm chmod +s /usr/local/bincpm
Set up your password db if you don't have one already:
cp conf/cpmrc-default ~/.cpmrc cd share/cpm ./import.sh general passwordsafe/example.txt cp -i cpm_convert.db ~/.cpmdb
And you are ready to go! RPMS package contributions are gratiously accepted!