Skip to content

Instantly share code, notes, and snippets.

@ZulianTiger
Created September 3, 2021 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZulianTiger/df2671b6191f17315f14dfde2ec4a36e to your computer and use it in GitHub Desktop.
Save ZulianTiger/df2671b6191f17315f14dfde2ec4a36e to your computer and use it in GitHub Desktop.
Whitelisting IP addres for remote postgres database access
//Connect t
ssh user@ip-address
//Navigate to postgres config
cd ../../etc/postgresql/12/main
//Open config file and scroll to bottom
sudo nano pg_hba.conf
//Add line to the end (Don't forget '/32' subnet mask at the end of IP address)
host all all 77.78.197.32/32 trust
//CTRL+X to save and now restart postgres service
sudo service postgresql restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment