0

I have below script as:

#!/bin/sh

. /filelocation/propertyfile.properties                    #key value pairs are stored here(KEY,PASSWORD,etc being used below)

# Executing java proc
exec java -Dproc.name='(java instance)' -DAPP_NAME="name of instance" -somearguements -Djavax.net.ssl.keyStore=$KEY -Djavax.net.ssl.keyStorePassword=$PASSWORD -Xms512m -Xmx1024m MainClass

After running the above script, I can see the process running using the ps command. But I also see the argument values key and passwords visible.

Can you please help me how can I hide those values?

Aplet123
  • 33,825
  • 1
  • 29
  • 55

1 Answers1

1

No way!

Do not put passwords in command line arguments and environment variables.

Read the password from a file descriptor in the same ways as GPG does it: How to use Gnupg's passphrase-fd argument?

ceving
  • 21,900
  • 13
  • 104
  • 178