2024. 7. 25. 17:14

[Postgresql] 외부접속 허용하기(퍼옴)

postgresql를 외부에서 접속 가능하도록 설정해보자. 

기본적으로 postgresql을 설치했다면 외부접속은 불가능하도록 되어 있다.

 

※ conf 파일들의 경로 : /etc/postgresql/10/main/

 

 

1) postgresql.conf 파일 수정

- listen_addresses = '*' 로 변경

2) pg_hba.conf 파일 수정

- IPv4 local connections 에서 host의 ADDRESS를 0.0.0.0/0으로 변경

3) postgresql 재시작

- sudo service postgresql restart

- netstat -nap | grep 5432 확인 (postgresql의 기본 포트는 5432)

 

 

출처 : https://tbmaster.tistory.com/89