From 1941d8e5c24f38798edd6a63b68a9687511f349c Mon Sep 17 00:00:00 2001 From: "Jonathan S. Katz" Date: Fri, 5 Apr 2019 12:02:40 -0400 Subject: [PATCH] Add a warning about the client authentication defaults that initdb provides. This also provides advice on how to securely set up initial client connection configurations, and removes the section that explains similar steps that is below the directory setup. This information should be around where its explained how initdb is first called, anyway. --- doc/src/sgml/runtime.sgml | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index fde9dbc134..dd1a8bc90f 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -85,6 +85,29 @@ described in the previous section. + + + By default initdb sets up trust + client authentication for connecting to the database. This is not + recommended on multi-user systems where you do not trust all users, nor if + the database server will be made accessible to remote systems. + + + We recommend using the , , + or flags to assign a password to the database + superuser, and to override the pg_hba.conf default + generation using for local connections, + and for remote connections. See + for more information on client + authentication methods. + + + If installing PostgreSQL from a distribution, we recommend you validate + your initially generated pg_hba.conf file to ensure + it meets your operational requirements. + + + As an alternative to the option, you can set @@ -155,27 +178,6 @@ postgres$ initdb -D /usr/local/pgsql/data for directories and 0640 for files. - - However, while the directory contents are secure, the default - client authentication setup allows any local user to connect to the - database and even become the database superuser. If you do not - trust other local users, we recommend you use one of - initdb's , - or options to assign a password to the - database superuser. - password - of the superuser - - Also, specify or - so that the default trust authentication - mode is not used; or modify the generated pg_hba.conf - file after running initdb, but - before you start the server for the first time. (Other - reasonable approaches include using peer authentication - or file system permissions to restrict connections. See for more information.) - - initdb also initializes the default localelocale for the database cluster. @@ -643,7 +645,7 @@ psql: could not connect to server: No such file or directory amount of anonymous mmap shared memory. Alternatively, a single large System V shared memory region can be used (see ). - + In addition a significant number of semaphores, which can be either System V or POSIX style, are created at server startup. Currently, POSIX semaphores are used on Linux and FreeBSD systems while other -- 2.14.3 (Apple Git-98)