nickjoIT

외부 접속 허용 본문

DB/postgresql

외부 접속 허용

nickjo 2017. 5. 11. 14:26

1. pg_hba.conf file 수정

sudo -u postgres vi /etc/postgresql/9.3/main/pg_hba.conf

위 파일을 열고 규칙을 수정한다.


# 모든 아이피 접속 가능

host   all              all             0.0.0.0/0              md5

# 특정 아이피에서 비밀번호 없이 접속 가능

host    all             all            192.168.0.5/32        trust

# 특정 아이피에서 접속 불가능
host    all             all            192.168.0.5/32        reject


2. postgres.conf 수정
listen_addresses 항목을 찾아 주석을 제거하고 다음과 같이 수정한다.

listen_addresses = '*'

3. 재시작
sudo service postgresql restart



[출처]
http://blog.secretmuse.net/?p=10


'DB > postgresql' 카테고리의 다른 글

alter password for user postgres  (0) 2017.06.25
pgadmin 실행  (0) 2017.03.09
[ubuntu]pgadmin4 설치  (0) 2017.03.05
sql 모음  (0) 2016.11.01
각종 조회  (0) 2016.09.27
Comments