Pypw : A simple python password manager

Quote

Pypw is a password manager written in python which aims to make your websites password management easier. It generates passwords associated to a user/website and store the new account to a password file. The most common bad pratice for most users is to use the same password for their main accounts and triggers out a security failure.

The password generation is based on keyword called “seed” as sha1 hash. The accounts are stored in a password file to the homedir of the script owner ($HOME/.pypwrc).

Another interest of this script is the reversibility of losing password. With both the data “seed” and “website” used to generate an account, it is possible to restore the lost password.

Pypw setup

Python >= Python2.5 has to be installed. If not :

apt-get install python-minimal

From github , please get the script :

wget http://github.com/Petteri/pypw/raw/master/pypw

For security reasons, another user with shell shouldn’t access to the password database :

chown user pypw
chmod 700 pypw

 

Configuration

Edit properly those parameters in the script :

 DEFAULTUSERNAME = "user"
DEFAULTSEED = "keyword"
DEFAULTPASSWORDLENGTH = 10

Move the script to the default binaries location :

mv pypw /usr/bin/pypw

 Quick start

  • Help: pypw -h
  • Generate a single password for website : pypw -u yourlogin planet-libre.org
  • List stored passwords : pypw -l
  • Add existing account : pypw -u user mysite.tld -a mypassword
  • Specify the password length : pypw -u user -n length mysite.tld
  • Delete existing password : pypw -d mypassword

Here we are about main features of this script. It does not aim to be ultra secure but to allow you to get better pratices for managing your passwords easily.

Author’s github : https://github.com/Petteri/pypw/

postfix add on software howto

Why another postfix howto whereas there are already a bunch available on the Internet?

Well, most postfix howtos you can find on the internet talk about postfix installation in various environnements. This howto only deals with some softwares you might want to add once you have set up postfix properly (but you’d better have an idea of which add on software you want before starting installing your mail server).

Several add-on software are necessary to get a fully functionnal mail server. Describing all of them here would take too long, therefore I’ll try to tell about the ones I use that are not very common.

If ever you favorite software is missing, please leave me a comment and i will try to add it here.

Installation instruction are detailled for FreeBSD, but you can use apt/pacman/emerge/yum/rpm/tar instead

maildrop

The program maildrop is what we call (in the obfuscated sysadmin slang) a MUA. It’s job is to recieve mail from an MTA (postfix) and deliver it to local user (who called them luser at this point? They don’t always run m$ Outhouse :) ).

Even if maildrop is part of courier suite, it can be installed as a standalone product. It’s written in C++, licensed under GPL and supports both mbox and Maildir.

    We assume the following scenario

  • No virtual user nor virtual domain (postfix acception)
  • Users have write access (ssh, ftp, sftp, svn, web api …) to their home directory or they won’t be able to filter their mail serverside.
  • Maildir format is used instead of mbox.

Installing from ports on FreeBSD:
cd /usr/ports/mail/maildrop && make install clean
Configure postfix to use maildrop as a MDA in /etc/postfix/main.cf:
mailbox_command = /usr/local/bin/maildrop -d ${USER}
If you need to set to system-wide options for maildrop, you can edit /usr/local/etc/maildroprc. Otherwise, for each regular user, edit ~mylocaluser/.mailfilter
MAILDIR="/home/mylocaluser/Maildir"
if (/ ^List-Post: <mailto:freebsd-current@freebsd.org>$/)
to $MAILDIR/.list
if (/ ^List-Post: <mailto:varnish-misc@varnish-cache.org>$/)
to $MAILDIR/.list

Why should I use MUA like maildrop or procmail while postfix knows how to deliver mail to both mbox and Maildir? Well, I don’t know about your needs but I felt very confortable without MUA until I subscribed a few mailing lists and wanted my mail to be sorted automatically. There are various other ways to achieve this, like using mutt in a screen or cyrus with sieve.

By the way, to use postfix as MDA with Maildir format, just edit /etc/postfix/main.cf:
home_mailbox = Maildir/

pflogsumm

No postfix server should be installed without pflogsumm. It’s a mere perl script designed to parse postfix logs and output a neat report.

Installing from ports on FreeBSD:
cd /usr/ports/mail/pflogsumm && make install clean
Use it:
bzcat /var/log/maillog.0.bz2 |pflogsumm

Further readings.