configuration question

Поиск
Список
Период
Сортировка
От yanot panara
Тема configuration question
Дата
Msg-id 1c0afa540709231943y1ecbe956s386760b2ea3ef70c@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi,
Im trying to setup my postgresql database for user authentication.

I have managed to install the libnss-pgsql module with the help of the following links below.
http://archives.postgresql.org/pgsql-general/2001-12/msg00760.php
http://archives.postgresql.org/pgsql-general/2001-12/msg00761.php

Im following the configuration steps from the link below (i had to translate it though)
http://www.claudineimatos.com/200703/autenticacao-centralizada-com-postgres-nss-e-pam/

my database shema can be found here - http://rafb.net/p/3CcM8G49.html

/etc/nss-pgsql.conf
connectionstring = hostaddr=localhost dbname=db user=db_nss password=xxx connect_timeout=1
getgroupmembersbyid = SELECT user_name FROM users WHERE gid = $1
getpwnam = SELECT user_name, passwd, 'desc' AS gecos, homedir, shell, uid, gid FROM users WHERE user_name=$1
getpwuid = SELECT user_name, passwd, 'desc' AS gecos, homedir, shell, uid, gid FROM users WHERE uid=$1
allusers = SELECT user_name, passwd, 'desc' AS gecos, homedir, shell, uid, gid FROM users
getgrnam = SELECT group_name, passwd, gid FROM groups WHERE group_name=$1
getgrid = SELECT group_name, passwd, gid FROM groups WHERE gid=$1
allgroups = SELECT group_name, passwd, gid FROM groups
groups_dyn = SELECT g.gid FROM users JOIN groups g USING (uid) where user_name = $1 and g.gid <>$2
getgroupmembersbygid = SELECT user_name FROM users JOIN user_groups g USING (uid) where g.id = $1

CREATE VIEW "shadow" AS (
SELECT user_name,
s.passwd,
DATE_PART('DAYS', lastchange-'2007-01-01') AS lastchange,
min,
max,
warn,
inact,
DATE_PART('DAYS', expire-'2007-01-01') AS expire
FROM
passwrd AS s
JOIN
users USING(uid)
);

/etc/nss-pgsql-root.conf
shadowconnectionstring = hostaddr= 127.0.0.1 dbname=db user=db connect_timeout=1
shadowbyname = SELECT user_name, passwd, lastchange, min, max, warn, inact, expire, '0' FROM shadow WHERE login = $1
shadow = SELECT user_name, passwd, lastchange, min, max, warn, inact, expire, '0' FROM shadow

edited /etc/nsswitch.conf and added the lines
passwd:     files pgsql
shadow:     files pgsql
group:      files pgsql

after those changes, its said that i should test it using the command #id myers but it returned id: myers: No such user
where did i go wrong?

steps i did can be found here - http://rafb.net/p/BdSYXr74.html

thanks in advance,
kris












В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 5 minutes to pg_dump nothing
Следующее
От: Ow Mun Heng
Дата:
Сообщение: SRF called with optional NULL input runs 7x slower