/dev/random

PostgreSQL Ident Authentication

assumes debian/ubuntu-ish linux flavor

install oidentd

$ sudo apt-get install oidentd

add to /etc/oidentd.conf

 user foo_user {
     default {
         deny spoof
         deny spoof_all
         deny spoof_privport
         allow random
         allow random_numeric
         allow numeric
         deny hide
     }
 }

add to /etc/postgresql/9.1/main/pg_hba.conf

 # TYPE   DATABASE   USER   ADDRESS   METHOD
 local    all        all              ident map=my_map

add to /etc/postgresql/9.1/main/pg_ident.conf

 # MAPNAME   SYSTEM-USERNAME   PG-USERNAME
 my_map      foo_user          pg_user

restart services

$ sudo service oidentd restart
$ sudo service postgresql restart

references