DOKK / manpages / debian 12 / pgpool2 / pg_md5.1.en
PG_MD5(1) pgpool-II 4.3.5 Documentation PG_MD5(1)

pg_md5 - produces encrypted password in md5

pg_md5 [option...] -p

pg_md5 [option...] password

pg_md5 produces encrypted password in md5.

-p
--prompt

Prompt password using standard input.

-m
--md5auth

Produce md5 authentication password to authentication file pool_passwd.

-u your_username
--username=your_username

When producing a md5 authentication password, create the pool_passwd entry for your_username.

-f config_file
--config-file=config_file

Specify the path to the pgpool.conf configuration file.

-i input_file
--input-file=input_file

Specifies file containing user name and password pairs.

The following are examples to encrypt your password into md5 hash format for pcp.conf.


$ pg_md5 -p
password: [your password]

or


$ pg_md5 [your password]
acbd18db4cc2f85cedef654fccc4a4d8

pg_md5 can also be used for adding an entry of user name and md5 encrypted password to pool_passwd authentication file.


$ pg_md5 -m -f /path/to/pgpool.conf -u username -p
password: [your password]
$ cat /path/to/pool_passwd
username:md55a231fcdb710d73268c4f44283487ba2

To avoid password prompt or password in command parameter, pg_md5 can read user name:password pairs from file. It will add all user names and md5 hashed password to pool_passwd authentication file.


$ cat users.txt
username1:secretpassword1
username2:secretpassword1
$ pg_md5 -m -f /path/to/pgpool.conf -i users.txt
trying to read username:password pairs from file users.txt
$ cat /path/to/pool_passwd
username1:md533314126ba0b187df1e37f5ce6a489a8
username2:md58ae92c6e1d6a48d80e2583fe715e2b36

To just display the md5 hashed string, not adding an entry to pool_passwd, pass a string concatenating password and user name. For example, if password is "password" and user name is "user", the output would be:


$ pg_md5 passworduser
4d45974e13472b5a0be3533de4666414

Please note that the actual entry to be inserted into pool_passwd should have "md5" on top of the result string. That is: "md54d45974e13472b5a0be3533de4666414".

2023 pgpool-II 4.3.5