'\" t .\" Title: pg_enc .\" Author: The Pgpool Global Development Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 2023 .\" Manual: pgpool-II 4.3.5 Documentation .\" Source: pgpool-II 4.3.5 .\" Language: English .\" .TH "PG_ENC" "1" "2023" "pgpool-II 4.3.5" "pgpool-II 4.3.5 Documentation" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" pg_enc \- AES256 password encryption utility .SH "SYNOPSIS" .HP \w'\fBpg_enc\fR\ 'u \fBpg_enc\fR [\fIoption\fR...] \fI\-p\fR .HP \w'\fBpg_enc\fR\ 'u \fBpg_enc\fR [\fIoption\fR...] \fIpassword\fR .SH "DESCRIPTION" .PP \fBpg_enc\fR AES256 password encryption utility\&. .SH "OPTIONS" .PP .PP \fB\-k \fR\fB\fIKEY_FILE\fR\fR .br \fB\-\-key\-file=\fR\fB\fIKEY_FILE\fR\fR .RS 4 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 \fIPGPOOLKEYFILE\fR\&. .RE .PP \fB\-K \fR\fB\fIENCRYPTION_KEY\fR\fR .br \fB\-\-enc\-key=\fR\fB\fIENCRYPTION_KEY\fR\fR .RS 4 Encryption key to be used for encrypting database passwords\&. .RE .PP \fB\-f \fR\fB\fICONFIG_FILE\fR\fR .br \fB\-\-config\-file=\fR\fB\fICONFIG_FILE\fR\fR .RS 4 Specifies the pgpool\&.conf file\&. .RE .PP \fB\-i \fR\fB\fIINPUT_FILE\fR\fR .br \fB\-\-input\-file=\fR\fB\fIINPUT_FILE\fR\fR .RS 4 Specifies file containing username and password pairs\&. .RE .PP \fB\-p\fR .br \fB\-\-prompt\fR .RS 4 Prompt for database password using standard input\&. .RE .PP \fB\-P\fR .br \fB\-\-prompt\-for\-key\fR .RS 4 Prompt for encryption key using standard input\&. .RE .PP \fB\-m\fR .br \fB\-\-update\-pass\fR .RS 4 Create encrypted password entry in the pool_passwd file\&. .RE .PP \fB\-u \fR\fB\fIyour_username\fR\fR .br \fB\-\-username=\fR\fB\fIyour_username\fR\fR .RS 4 Creates the pool_passwd entry for the database user called your_username\&. .RE .PP \fB\-h\fR .br \fB\-\-help\fR .RS 4 Prints the help for pg_enc\&. .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP If you are providing the password as an argument to pg_enc and the password contains a "$" character, you must escape it\&. .PP For example, if you want to use "ABC$123" as password, .sp .if n \{\ .RS 4 .\} .nf pg_enc \-m \-f /path/to/pgpool\&.conf \-u username ABC\e$123 .fi .if n \{\ .RE .\} .sp .5v .RE .SH "EXAMPLE" .PP Here is an example output: .sp .if n \{\ .RS 4 .\} .nf pg_enc \-p db password: [your password] .fi .if n \{\ .RE .\} .PP or .sp .if n \{\ .RS 4 .\} .nf \&./pg_enc foo trying to read key from file /home/pgpool/\&.pgpoolkey jglid1QRgiCl/vfhHUDyVA== pool_passwd string: AESjglid1QRgiCl/vfhHUDyVA== .fi .if n \{\ .RE .\} .PP pg_enc can be used for pool_passwd passwords with: .sp .if n \{\ .RS 4 .\} .nf pg_enc \-m \-f /path/to/pgpool\&.conf \-u username \-p db password: [your password] .fi .if n \{\ .RE .\} .sp which will add an entry for username with the password given\&. .PP 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\&. .sp .if n \{\ .RS 4 .\} .nf $ 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== .fi .if n \{\ .RE .\} .sp