要在Ubuntu上实现pgAdmin远程访问,可按以下步骤操作:
sudo apt update
和sudo apt install postgresql pgadmin4
。postgresql.conf
文件,将listen_addresses
设为'*'
,允许所有IP连接。pg_hba.conf
文件,添加host all all 0.0.0.0/0 md5
,允许远程连接。sudo systemctl restart postgresql
。sudo ufw allow 5432/tcp
开放端口。