Difference between revisions of "PostgreSQL"

(Created page with "Category:Linux Category:Development Required packages <syntaxhighlight lang="bash"> apt-get install postgresql postgresql-doc </syntaxhighlight> Configuration Ed...")
 
Line 26: Line 26:
 
########
 
########
 
# Allow postgresql super administrator login, using password
 
# Allow postgresql super administrator login, using password
local  all        pgdba                            md5
+
local  all        postgres                          md5
 
# Allow other users connection
 
# Allow other users connection
 
local  all        all                              trust
 
local  all        all                              trust

Revision as of 18:25, 24 April 2015


Required packages

apt-get install postgresql postgresql-doc


Configuration

Edit the server configuration file

vim /etc/postgresql/xxx/main/


Adjust the access rights, at the end:

######## 
# USER access
########
# Allow postgresql super administrator login, using password
local   all         postgres                          md5
# Allow other users connection
local   all         all                               trust


########
# IP@ filtering 
#######
### No password required
# Enable localhost
host    all         all         127.0.0.1/32          trust
host    all         all         ::1/128               trust
# Enable specific host(s)
host    all         all         172.16.100.62/32      trust

### Forbid remote connection for non-trusted locations
host    all         pgdba       0.0.0.0/0             reject

### Password required 
# Local network 
host    all         all         172.16.100.0/24        md5
# Specific host(s)
host    all         all         5.39.81.23/32          trust

### Reject other incoming connections
host    all         all         0.0.0.0/0             reject


References