動作確認ディストリビューション †PostgreSQLへのcrypt認証による接続 †※PostgreSQLの設定ファイル(/usr/local/pgsql/data/pg_hba.conf)にて、 ---Start---------------------------------------------------- # TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD 許可ホストのtrust指定を確認↓ local all all trust host all all 127.0.0.1 255.255.255.255 trust host all all 192.168.0.0 255.255.255.0 trust host all all 192.168.0.254 255.255.255.255 reject ---End------------------------------------------------------ パスワードの設定 $ psql template1 Welcome to psql 7.3.3, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit ↓入力待ちになったらパスワードを設定するコマンドを入力。 template1=# alter user postgres with unencrypted password 'パスワードを入力'; ↓設定確認 template1=# select * from pg_shadow; ※unencrypted指定により、パスワードが平文にて、システムテーブルpg_shadowに設定される。 ↓終了 template1=# \q PostgreSQLの設定ファイル(/usr/local/pgsql/data/pg_hba.conf)の修正 ---Start---------------------------------------------------- # TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD 許可ホストをcrypt指定に修正↓ local all all crypt host all all 127.0.0.1 255.255.255.255 crypt host all all 192.168.0.0 255.255.255.0 crypt host all all 192.168.0.254 255.255.255.255 reject ---End------------------------------------------------------ 再起動 # /etc/rc.d/init.d/postgresql restart crypt認証によるログイン $ psql template1 Password: ← 設定したパスワードを入力 ↓パスワード入力後ログインできれば成功 Welcome to psql 7.3.3, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit template1=# ※上記設定により、システムテーブルpg_shadowに、平文パスワードが格納され、クライアント/サーバー間の認証は、暗号化されたパスワードによる認証が行われます。
|