1. 远程目标主机环境
Debian 10
2. 报错内容
发生致命错误:没有用于主机“…”,用户“…”,数据库“…”,SSL关闭的pg_hba.conf记录。
3. 解决过程
3.1 找到 postgresql.conf 和 pg_hba.conf 这两个文件
|
|
3.2 设置 postgresql 外网访问
3.2.1 检查配置文件 postgresql.conf
listen_addresses = '*'
3.2.2 修改 pg_hba.conf 在文件末尾新加一行
|
|
4. 重启 postgresql ,远程连接成功
systemctl restart postgresql