我无法连接到安装postgresql的aws远程ubuntu服务器。我想从我的电脑连接到ubuntu上的postgres,我不能这样做:
Unable to connect to server:
FATAL: no pg_hba.conf entry for host "xxx.xxx.xxx.xxx", user "postgres", database "postgres", SSL on
FATAL: no pg_hba.conf entry for host "xxx.xxx.xxx.xxx", user "postgres", database "postgres", SSL off我知道我应该加上
host all all all md5
or
host all all 0.0.0.0/0 trust
or
host all all 0.0.0.0/0 md5但是,当我想从Putty打开pg_hba.conf时,我做了sudo nano /etc/postgresql/12/main/bg_hba.conf,我看到空列表,下面写着“但是在/etc/postgresql/12/main/中,我看到了这个文件/etc/postgresql/12/main/bg_hba.conf
如果我使用sudo sh -c 'echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/12/main/bg_hba.conf',我将创建新的文件bg_hba.conf,但所有者将是root用户。以下是一些细节:
$ psql -V
psql (PostgreSQL) 12.2 (Ubuntu 12.2-2.pgdg18.04+1)
$ pg_config --version
PostgreSQL 12.2 (Ubuntu 12.2-2.pgdg18.04+1)
$ postgres -V
$ locate bin/postgres
/usr/lib/postgresql/12/bin/postgres
$ /usr/lib/postgresql/12/bin/postgres -V
postgres (PostgreSQL) 12.2 (Ubuntu 12.2-2.pgdg18.04+1)
$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
12 main 5432 online postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
$ /etc/postgresql/12/main/pg_hba.conf
-bash: /etc/postgresql/12/main/pg_hba.conf: Permission denied请帮帮我!在/etc/postgresql/12/main/postgresql.conf中,我有listen_addresses = '*',我看到postgresql.conf有rw-r--r--,bg_hba.conf是rw-r-----,我看不懂为什么和如何更改thad)
发布于 2020-05-08 13:33:06
好吧!我遇到了问题,在'bg_hba.conf' -> 'pg_hba.conf' /etc/postgresql/12/main/bg_hba.conf'的文本路径上出现了一个小错误-> /etc/postgresql/12/main/pg_hba.conf'
https://askubuntu.com/questions/1236986
复制相似问题