PostgreSQL remote link server configuration

PostgreSQL server needs to be configured to be remotely linked by users Profile:pg_hba.conf controls access security and manages the access rights of ...
PostgreSQL server needs to be configured to be remotely linked by users

PostgreSQL server needs to be configured to be remotely linked by users

Profile:
pg_hba.conf controls access security and manages the access rights of clients to access PostgreSQL server.
postgresql.conf database parameter file, configure database related parameters.
PG ﹣ ident.conf client access server through ident mode, will use PG ﹣ ident.conf file to simulate operating system user access.

PG view profile location

postgres=# select name, setting from pg_settings where category = 'File Locations'; name | setting -------------------+--------------------------------- config_file | /opt/pgsql/data/postgresql.conf data_directory | /opt/pgsql/data external_pid_file | hba_file | /opt/pgsql/data/pg_hba.conf ident_file | /opt/pgsql/data/pg_ident.conf (5 rows)

Configure server for remote access

1. Configure pg_hba.conf

# "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust host all all 0.0.0.0/0 md5 # IPv6 local connections: host all all ::1/128 trust

md5 login with password

2. Configure listening postgresql.conf

#listen_addresses = 'localhost' # what IP address(es) to listen on; listen_addresses = '*' # what IP address(es) to listen on;

3. Set password for initial user

alter user postgres with password 'ikdhfel';

4. Restart pg server to test the remote link after all configuration files are configured

[postgres@postgresql data]$ pg_ctl restart -D /opt/pgsql/data waiting for server to shut down.... done server stopped waiting for server to start....2018-12-10 16:40:29.828 CST [636] LOG: listening on IPv4 address "0.0.0.0", port 5432 2018-12-10 16:40:29.828 CST [636] LOG: listening on IPv6 address "::", port 5432 2018-12-10 16:40:29.833 CST [636] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2018-12-10 16:40:29.857 CST [637] LOG: database system was shut down at 2018-12-10 16:40:29 CST 2018-12-10 16:40:29.861 CST [636] LOG: database system is ready to accept connections done server started

2 December 2019, 08:08 | Views: 9521

Add new comment

For adding a comment, please log in
or create account

0 comments