Set the path to the encryption key file. Default is the .pgpoolkey file located in the users home directory, which can be overridden by the environment variable PGPOOLKEYFILE.
Encryption key to be used for encrypting database passwords.
Specifies the pgpool.conf file.
Specifies file containing username and password pairs.
Prompt for database password using standard input.
Prompt for encryption key using standard input.
Create encrypted password entry in the pool_passwd file.
Creates the pool_passwd entry for the database user called your_username.
Prints the help for pg_enc.
Here is an example output:
pg_enc -p db password: [your password]
./pg_enc foo trying to read key from file /home/pgpool/.pgpoolkey jglid1QRgiCl/vfhHUDyVA== pool_passwd string: AESjglid1QRgiCl/vfhHUDyVA==
pg_enc can be used for pool_passwd passwords with:
pg_enc -m -f /path/to/pgpool.conf -u username -p db password: [your password]
which will add an entry for username with the password given.
To avoid password prompt or password in command parameter, pg_enc can read user name:password pairs from file. It will add all user names and encrypted password to pool_passwd authentication file.
$ cat users.txt username1:secretpassword1 username2:secretpassword2 $ pg_enc -m -f /path/to/pgpool.conf -i users.txt trying to read key from file /home/pgpool/.pgpoolkey trying to read user:password pairs from file users.text $ cat /path/to/pool_passwd username1:AESrx5QdpGyW/+4CB80KWtwhg== username2:AESUAdohy7nCUhWliRI9WiYQA==