Потому что вы даже не прочитали что там написано
# "local" is for Unix domain socket connections only
local all all trust
Тут вы разрешили всем из внешней сети доступ
# IPv4 local connections:
host all all 127.0.0.1/32 md5
Тут вы поставили md5 от localhosta IPv4
# IPv6 local connections:
host all all ::1/128 md5
Тут вы поставили md5 от localhosta IPv6
А правильно это выглядит так
# "local" is for Unix domain socket connections only
local all all password
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
psql -U postgres -c "ALTER USER postgres PASSWORD 'ПАРОЛЬ"