Peer authentication
in the error means you're not trying to connect remotely, but locally. You must review the settings in database.yml
. See
PG Peer authentication failed for a related question.
Once you're ready to connect to the real remote server, that'll probably still won't work with the pg_hba.conf
linked to in the comments because of:
host all all * md5
host all all [AWS-PINGED-IP] md5
host all all [AWS-SPECIFIED-PUBLIC-IP] md5
*
is not accepted as an IP address mask, shell wildcards syntax is not welcome here. Use 0.0.0.0/0
in CIDR notation to mean "any IPv4 address".
Or remove entirely this line if you didn't mean to accept connections from any address, which seems to be the case given the two lines after.
Note that rules interpretation stops at the first match in order of declaration, so it doesn't make sense to have an "accept-all" rule followed by a much more restrictive rule, as the latter will always be ignored.