PostgreSQL 은 postgresql.conf 파일과 pg_hba.conf 파일을 통해
특정 서버에서 특정 사용자에만 접속이 가능하도록 제한할 수 있습니다.
이 오류는 pg_hba.conf 파일에 인증이 적용되어 있지 않기 때문입니다.
FATAL: no pg_hba.conf entry for host "192.168.56.103", user "postgres", database "postgres", SSL off error |
치명적오류: 호스트 "192.168.56.103", 사용자 "postgres", 데이터베이스 "postgres", SSL 중지 연결에 대한 설정이 pg_hba.conf 파일에 없습니다. |
먼저 pg_hba.conf 파일에 대한 구조와 값들을 이해하고 계셔야 합니다.
pg_hba.conf 파일에 대한 자세한 내용은 아래 URL 을 참고해 주세요.
아래는 pg_hba.conf 파일의 기본상태입니다.
ADDRESS 부분을 보면 어디에서도 외부에서 접속이 가능하도록 IP 가 적용되어 있는 부분이 없습니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
|
cs |
이렇게 설정된 파일 하단에 모든 IP 에서 모든 사용자, 데이터베이스에 접속가능하도록 설정을 추가해 주었습니다.
지금은 테스트라 이렇게 설정했지만, 라이브인 경우에는 주의하여 다뤄주시기 바랍니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
host all all 0.0.0.0/0 md5
|
cs |
적용이 완료되었으면 PostgreSQL 을 재구동해서 pg_hba 설정값을 적용해줍니다.
[PostgreSQL] Connection to refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. 오류 해결하기 (0) | 2021.04.26 |
---|---|
[PostgreSQL] PostgreSQL 의 프로세스와 폴더 구조 (0) | 2021.04.14 |
[PostgreSQL] PostgreSQL XID 설명 (0) | 2021.04.05 |
[PostgreSQL] PostgreSQL Vacuum 이란 ( FSM, VM, TID ) (0) | 2021.04.05 |
[PostgreSQL] PostgreSQL 아카이브 백업과 특정시점 복구방법 (0) | 2021.04.05 |
본문과 관련 있는 내용으로 댓글을 남겨주시면 감사하겠습니다.