---
name: "pg_md5"
section: "1"
platform: "linux"
package: "pgpool2"
version: "4.6.1-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pg_md5"
---

# pg\_md5(1)

produces encrypted password in md5

## NAME

pg\_md5 - produces encrypted password in md5

## SYNOPSIS

**pg\_md5** \[*option*...\] *-p*

**pg\_md5** \[*option*...\] *password*

## DESCRIPTION

**pg\_md5** produces encrypted password in md5.

## OPTIONS

- **-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.

## EXAMPLE

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:secretpassword2
$ 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".
