要实现Debian上pgAdmin的远程访问,可按以下步骤操作:
/etc/postgresql/<版本>/main/postgresql.conf,将listen_addresses设为'*'以允许所有IP连接。/etc/postgresql/<版本>/main/pg_hba.conf,添加host all all 0.0.0.0/0 md5(生产环境建议限制IP段)。sudo systemctl restart postgresql。sudo ufw allow 5432/tcp开放端口。