要實現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開放端口。