PostgreSQL

Revision as of 17:21, 24 April 2015 by WikiFreak (talk | contribs) (Created page with "Category:Linux Category:Development Required packages <syntaxhighlight lang="bash"> apt-get install postgresql postgresql-doc </syntaxhighlight> Configuration Ed...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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         pgdba                             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