Only the PostgreSQL OS user (postgres
) and its group are allowed to access the PostgreSQL data directory. See this code from the source:
/*
* Check if the directory has correct permissions. If not, reject.
*
* Only two possible modes are allowed, 0700 and 0750. The latter mode
* indicates that group read/execute should be allowed on all newly
* created files and directories.
*
* XXX temporarily suppress check when on Windows, because there may not
* be proper support for Unix-y file permissions. Need to think of a
* reasonable check to apply on Windows.
*/
#if !defined(WIN32) && !defined(__CYGWIN__)
if (stat_buf.st_mode & PG_MODE_MASK_GROUP)
ereport(FATAL,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("data directory \"%s\" has invalid permissions",
DataDir),
errdetail("Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).")));
#endif
If the data directory allows the group in, the group will normally also have permissions for pg_control
.
So you can allow that pgBackRest user in if you give it postgres
' primary user group.
postgres
is allowed to create a crontab
if the system is configured accordingly.
From man crontab
:
Running cron
jobs can be allowed or disallowed for different users. For this purpose, use the cron.allow
and cron.deny
files. If the cron.allow
file exists, a
user must be listed in it to be allowed to use cron
If the cron.allow
file does not exist but the cron.deny
file does exist, then a user must not be listed in
the cron.deny
file in order to use cron
. If neither of these files exists, only the super user is allowed to use cron
. Another way to restrict access to cron
is to use PAM authentication in /etc/security/access.conf
to set up users, which are allowed or disallowed to use crontab
or modify system cron
jobs in the
/etc/cron.d/
directory.