This section is from the "Practical PostgreSQL" book, by John Worsley and Joshua Drake. Also available from Amazon: Practical PostgreSQL.
The following is a series of examples that can be used within the pg_hba.conf . The first allows a single IP to connect to all databases, without the use of a password.
Example 6-10. Single host entry.
host all 192.168.1.10 255.255.255.255 trust
This example will reject all users from host 192.168.1.10.
Example 6-11. Example of a rejection entry
host all 192.168.1.10 255.255.255.255 reject
This example will allow any user, with the IP of 192.168.1.10 and a valid password to connect to the database template1. The password will be encrypted during authentication.
Example 6-12. Single host, single database entry.
host template1 192.168.1.10 255.255.255.255 crypt
This example allows a small subnet of computers to access the booktown database.
Example 6-13. Small network connection entry
host booktown 192.168.1.0 255.255.255.240 trust
 
Continue to: