[CentOS] bash script input password automatically.

Tue Jul 26 08:35:08 UTC 2022
Strahil Nikolov <hunter86_bg at yahoo.com>

Or just try:echo PASS | your_script.sh
If it needs to answer multie prompts:echo -e 'USER\nPASS' | your_script.sh
Best Regards,Strahil Nikolov 
  On Fri, Jul 22, 2022 at 23:06, Paul Heinlein<heinlein at madboa.com> wrote:   On Fri, 22 Jul 2022, Kaushal Shriyan wrote:

> Hi,
> I have the below commands to generate keystore.pkcs12 and keystore.jks
> files on CentOS Linux release 7.9.2009 (Core)
> openssl pkcs12 -export -clcerts -in fullchain1.pem -inkey privkey1.pem -out
> keystore.pkcs12 -name javasso
> keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype pkcs12
> -destkeystore keystore.jks -deststoretype jks -alias javasso
> I have created a small shell script to generate both keystore.pkcs12 and
> keystore.jks files. It prompts for a password. Is there a way to key in a
> password without prompt or non-interactive way?
> For example password is stored in a file and the bash script will source it
> instead of manually typing the password.
> Please suggest. Thanks in advance.

See the "PASS PHRASE ARGUMENTS" section of the openssl(1) man page for 
the various ways openssl can get a password.

Paul Heinlein
heinlein at madboa.com
45°22'48" N, 122°35'36" W
CentOS mailing list
CentOS at centos.org