Назад | Перейти на главную страницу

Ошибка аутентификации postgres autopostgresqlbackup

Я пытаюсь использовать autopostgresqlbackup в ubuntu на экземпляре ec2. Я могу войти в систему с помощью psql в командной строке, и он забирает мой файл .pgpass, и все выглядит нормально. Когда я запускаю sudo autopostgresqlbackup, он просто зависает, и в моем файле ошибок упоминается, что он ждет пароля для пользователя postgres.

Вот мои файлы конфигурации и журнал ошибок. Я использую пользователя ubuntu, и мой файл /home/ubuntu/.pgpass настроен с разрешениями 0600. Я предполагаю, что это как-то связано с тем, с каким пользователем я вошел в систему и какого пользователя указать в строке конфигурации SU_USERNAME. Должен ли я установить SU_USERNAME = ubuntu? Любая помощь здесь будет оценена. Спасибо.

/ и т.д. / по умолчанию / autopostgresqlbackup

# ===============================
# === Debian specific options ===
#================================

# By default, on Debian systems, only 'postgres' user
# is allowed to access PostgreSQL databases without password.
# In order to dump databases we need to run pg_dump/psql
# commands as 'postgres' with su.
#
# The following setting has been added to workraound this issue.
# (if it is set to empty, 'su' usage will be disabled)
SU_USERNAME=postgres

#=====================================================================
# Set the following variables to your system needs
# (Detailed instructions below variables)
#=====================================================================

# Username to access the PostgreSQL server e.g. dbuser
USERNAME=postgres

# Password
# create a file $HOME/.pgpass containing a line like this
#   hostname:*:*:dbuser:dbpass
# replace hostname with the value of DBHOST and postgres with 
# the value of USERNAME

# Host name (or IP address) of PostgreSQL server e.g localhost
DBHOST=localhost

# List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3"
DBNAMES="all"

/var/lib/autopostgresqlbackup/ERRORS_localhost-881271020.log

Password for user postgres: 
Session terminated, terminating shell... ...killed.

pg_hba.conf

local   all             postgres                                md5
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
host        all         all      207.244.165.220/32        md5
host        all         all      207.244.173.30/32        md5