PG_ENC(1)
π PG_ENC π
okay bestie, so this is pg_enc, the AES256 password encryption utility from the pgpool-II 4.7.2 documentation set. she encrypts your database passwords and she does it flawlessly, no cap. let's get into it π«Ά
β¨ SYNOPSIS β¨
pg_enc [option...] -p
pg_enc [option...] password
like, two whole moods. either you're prompting for the password, or you're just handing it over directly. choose your fighter π
πΈ DESCRIPTION πΈ
pg_enc is the AES256 password encryption utility. that's it. that's the whole job. she encrypts passwords with AES256 and she's iconic for it. periodt. π
π OPTIONS π
every single flag, right here, no skips, we don't gatekeep:
-k KEY_FILE,--key-file=KEY_FILEβ sets the path to the encryption key file. the default is the.pgpoolkeyfile chillin' in your home directory, but you can override that with thePGPOOLKEYFILEenvironment variable. iykyk. π-K ENCRYPTION_KEY,--enc-key=ENCRYPTION_KEYβ the encryption key that gets used for encrypting database passwords. just, like, hand it over directly.-f CONFIG_FILE,--config-file=CONFIG_FILEβ specifies thepgpool.conffile. yes, that one. ποΈ-i INPUT_FILE,--input-file=INPUT_FILEβ specifies the file containing username and password pairs. very organized of you honestly.-p,--promptβ prompts for the database password using standard input. the classic. the main character entrance. β¨-P,--prompt-for-keyβ prompts for the encryption key using standard input. (note: lowercase-pis the password, uppercase-Pis the key. do not mix them up bestie, i am begging π)-m,--update-passβ creates an encrypted password entry in thepool_passwdfile. the whole point, honestly. π₯-u your_username,--username=your_usernameβ creates thepool_passwdentry for the database user called your_username. put a name on it.-h,--helpβ prints the help forpg_enc. when in doubt,-hit out. π¦
β οΈ Note (important, read this)
If you are providing the password as an argument topg_encand the password contains a"$"character, you must escape it.
like, seriously. the shell will eat that $ alive and not tell you. π
for example, if you want to use "ABC$123" as password,
pg_enc -m -f /path/to/pgpool.conf -u username ABC\$123
see the backslash? yeah. that's the whole thing.
π EXAMPLE π
here's an example output, so you know what you're getting into:
pg_enc -p
db password: [your password]
or
./pg_enc foo
trying to read key from file /home/pgpool/.pgpoolkey
jglid1QRgiCl/vfhHUDyVA==
pool_passwd string: AESjglid1QRgiCl/vfhHUDyVA==
look at that output. clean. crisp. ate. π
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. easy. iconic. done. π
π§ reading pairs from a file (the avoid-the-prompt route)
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==
batch processing your credentials? obsessed. no typing, no escaping drama, no stress. the file does the work for you. π
and that's the whole page bestie. this was pg_enc from the pgpool-II 4.7.2 documentation, dated 2023, filed under PG_ENC(1). go encrypt something and be free. πβ¨
π¦ where this page comes from
- ubuntu stonking: pgpool2 4.7.2-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms