NSS with PostgreSQL
NSS allows to the users stored in the Vhffs database to be recognized by the system, so they could act as standart unix users and can connect through ssh, use svn, or FTP pure-ftpd.
Installation :
- Install debian packages
aptitude install libnss-pgsql1 nscd
libnss-pgsql has several bugs. So you must use nscd to allow the vhffs users to connect through ssh.
As alternative, you can configure nss with sqlite (French only).
- Create config file with the example provided:
cp /usr/share/doc/libnss-pgsql1/examples/nss-pgsql.conf /etc/nss-pgsql.conf
then edit it /etc/nss-pgsql.conf like this :
# example configfile for PostgreSQL NSS module # these are entries as used with the BOFHMS tool (sf.net/projects/bofhms) host = localhost port = 5432 database = vhffs login = vhffs passwd = ******* passwdtable = vhffs_shadow grouptable = vhffs_groups # you can use anything postgres accepts as table expression groupmembertable = vhffs_passwd JOIN vhffs_user_group ON vhffs_passwd.uid=vhffs_user_group.uid JOIN vhffs_groups ON vhffs_groups.gid=vhffs_user_group.gid passwd_name = username passwd_passwd = passwd passwd_uid = uid passwd_dir = homedir passwd_shell = shell passwd_gecos = username passwd_gid = gid group_name = groupname group_passwd = passwd group_gid = gid group_member = username
then edit the file /etc/nsswitch.conf and modify:
passwd: compat pgsql group: compat pgsql shadow: compat pgsql