мой первый вопрос, размещенный здесь.
Прямо сейчас у меня есть ноутбук с Ubuntu 12.04, на котором работает PostgreSQL 9.01, на той же машине, что и виртуализированная Fedora 18, работающая под управлением VirtualBox 4.2. .12.
В этой виртуализированной Fedora у меня есть клиент PostgreSQL, и я хочу подключиться к серверу PostgreSQL, работающему на Ubuntu.
Я отредактировал файл /etc/postgresql/9.1/main/postgresql.conf
на сервере Ubuntu, чтобы разрешить подключения:
listen_addresses = '*'
А также я редактирую файл /etc/postgresql/9.1/main/pg_hba.conf в той же Ubuntu, чтобы разрешить пользователю postgres подключаться к тесту базы данных:
local postgres test md5
Но когда я пытаюсь подключиться из Fedora, на PgAdmin3 появляется следующее сообщение об ошибке:
Access to database denied
The server doesn't grant access to the database: the server reports
FATAL: no pg_hba.conf entry for host "192.168.1.239", user "postgres", database "jpa",
SSL on FATAL: no pg_hba.conf entry for host "192.168.1.239", user "postgres",
database "jpa", SSL off
To access a database on a PostgreSQL server, you first have to grant primary access
to the server for your client (Host Based Authentication).
PostgreSQL will check the pg_hba.conf file if a pattern that matches
your client address / username / database is present and enabled before any
SQL GRANT access control lists are evaluated.
The initial settings in pg_hba.conf are quite restrictive, in order to avoid
unwanted security holes caused by unreviewed but mandatory system settings.
You'll probably want to add something like host all all 192.168.0.0/24 md5
This example grants MD5 encrypted password access to all databases to all users
on the private network 192.168.0.0/24.
You can use the pg_hba.conf editor that is built into pgAdmin III
to edit the pg_hba.conf configuration file.
After changing pg_hba.conf, you need to trigger a server configuration reload
using pg_ctl or by stopping and restarting the server process.
Мой pg_hba.conf:
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 10.0.2.15/16 md5
#local postgres postgres md5
#local postgres jpa md5
#local postgres test md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
И 10.0.2.15 это IP-адрес виртуализированной Fedora.
Спасибо!