To connect to a remote postgresql database I need to use an ssh tunnel. But unfortunately the remote side is configured to only accept connections on the unix domain socket. I have no authority to alter the database configuration.
The pg_hba.conf File reads as follows:
# PostgreSQL Client Authentication Configuration for IServ
# TYPE DATABASE USER CIDR-ADDRESS METHOD
#
local all proftpd trust
local all all ident map=map1
host all rsyslogd 127.0.0.1/32 md5
host all rsyslogd ::1/128 md5
#host all all 127.0.0.1/32 md5
#host all all ::1/128 md5
I can connect to the remote machine via ssh and use psql client without further authentication. But I need to write a Python script using SSHTunnelForwarder or similar method.
currently I get the following error:
OperationalError: connection to server at "0.0.0.0", port 33153 failed: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "root", database "iserv", SSL off
Is there any solution around?