Skip to content

Instantly share code, notes, and snippets.

@tristan-k
Created January 24, 2017 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tristan-k/9572791455a9e7aa5c698169c07efc62 to your computer and use it in GitHub Desktop.
Save tristan-k/9572791455a9e7aa5c698169c07efc62 to your computer and use it in GitHub Desktop.
pg_hba.conf
cat /etc/postgresql/9.4/main/pg_hba.conf | grep host
# This file controls: which hosts are allowed to connect, how clients
# host DATABASE USER ADDRESS METHOD [OPTIONS]
# hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
# socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
# ADDRESS specifies the set of hosts the record matches. It can be a
# host name, or it is made up of an IP address and a CIDR mask that is
# specifies the number of significant bits in the mask. A host name
# that starts with a dot (.) matches a suffix of the actual host name.
# columns to specify the set of hosts. Instead of a CIDR-address, you
# can write "samehost" to match any of the server's own IP addresses,
# "host" records. In that case you will also need to make PostgreSQL
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment