I'm trying to configure a PostgreSQL instance running on SERVER_A to connect to another PostgreSQL instance on SERVER_B. I'm running a shell script on SERVER_A that ultimately needs to connect and execute a pg_restore onto a database that resides on SERVER_B.
SERVER_B is on Amazon's AWS. Normally, to ssh into the machine, I would run the following commands:
# ssh -i .ssh/server-dev.pem root@dev.hostname.com
[root@dev]# ssh -i .ssh/dev1mac 0.0.0.0
...With the Postgres instance residing at 0.0.0.0
Can anyone help explain to me how I would use the above information to configure Postgres on SERVER_A? I have been looking into pg_hba.conf, but quite frankly I've never done this before and from the documentation, it's not clear to me how to achieve my desired result. Is there perhaps an easier way that would allow me to skip configuring Postgres altogether, and instead just run a series of commands from my shell script to achieve the restore?
I'd appreciate any help, thanks!