"trust" authentication in pg_hba.conf

Started by Chris Withersover 10 years ago3 messagesgeneral
Jump to latest
#1Chris Withers
chris@simplistix.co.uk

Hi All,

What's the default contents of pg_hba.conf that postgres ships with?

I've been to it contains 'trust' for all local connections.
Is this wise? Anyone who can get a shell on your database server can
connect to any database as any user?

cheers,

Chris

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2John R Pierce
pierce@hogranch.com
In reply to: Chris Withers (#1)
Re: "trust" authentication in pg_hba.conf

On 11/24/2015 1:33 PM, Chris Withers wrote:

What's the default contents of pg_hba.conf that postgres ships with?

I've been to it contains 'trust' for all local connections.
Is this wise? Anyone who can get a shell on your database server can
connect to any database as any user?

it varies with distributions, and it can be specified via the -A/--auth
argument to initdb. most distributions I've seen use 'peer' for local
connections by default.

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Stephen Frost
sfrost@snowman.net
In reply to: Chris Withers (#1)
Re: "trust" authentication in pg_hba.conf

* Chris Withers (chris@simplistix.co.uk) wrote:

What's the default contents of pg_hba.conf that postgres ships with?

The PG community provides both source code, which is expected to be used
by developers and is therefore wide open, and binary packages, which are
expected to be used by end users and therefore has sensible defaults for
authentication (mainly 'peer').

I've been to it contains 'trust' for all local connections.
Is this wise? Anyone who can get a shell on your database server can
connect to any database as any user?

It is not wise to run with 'trust' in a non-development environment.

Thanks!

Stephen