Client Authentication

Connection type can have the following values, local, host, hostssl and hostnossl. The method type can have the following values, trust, reject, md5, crypt, password, krb5, ident, pam or ldap a series of examples will help us better understand how we can configure different access to the PostgreSQL cluster. Example 1-Tcp/ip (network) access to the database test001, as user test from the computer with IP 10.0.0.100, and md5 authentication method: test001 10.0.0.100 test host 255.255.255.255 md5 this same entry is could write also with the mask of network in CIDR notation: host test001 10.0.0.100/32 md5 test example 2-test001 database access by tcp/ip (network), as user test from all the computers on the 10.0.0.0 network, with mask 255.255.255.0 network (254 computers in total) and md5 authentication method: test001 test 10.0.0.0 host 255.255.255.0 md5 this same entry is could write also with the mask of network in CIDR notation: host test001 test 10.0.0.0/24 md5 example 3.-access by tcp/ip (network), encrypted, all of our cluster databaseas user test from the computer with IP 10.0.0.100, and computer 10.1.1.100 and md5 authentication method (we need two entries in our pg_hba.conf file:) Interactive terminal. Type: copyright for distribution terms h for help with SQL commands? for help with psql commands g or terminate with semicolon to execute query q to quit postgres = # SELECT pg_reload_conf; pg_reload_conf – t (1 row) postgres = # for a documentation detailed on the pg_hba.con file, go through the Chapter 20 section. Client Authentication of official documentation of PostgreSQL. PostgreSQL.conf changes we make in this file affect all of the databases that we have defined in our PostgreSQL cluster. Most of the changes can be put into production with a simple reload (/ usr/local/bin/pg_ctl – D /var/pgsql/data reload), other changes require that we launch again our cluster (/ usr/local/bin/pg_ctl – D /var/pgsql/data restart). More information on all the parameters that we can change this file, affecting and as they can be put into production it can be found in section 17.

Comments are closed.