How to hiding Password in the joblog

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Gerald sui
Participant
Posts: 22
Joined: Wed Jul 18, 2007 2:59 am

How to hiding Password in the joblog

Post by Gerald sui »

Hi,All.I have one job Sequence that using one Execute_Command activity to invoke one shell script to achieve some particular purpose.And I need pass some password values through the Execute_Command activity to script, then these password values will be displayed in the job log.But this is not allowed.Can anyone told me how to hiding the password values in the joblog.
Thank you so much in advance for any reply.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Pre-set the the password (and anything else you'd like) in an environment variable, and make reference to that environment variable in the script rather than hard-coding the password.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Gerald sui
Participant
Posts: 22
Joined: Wed Jul 18, 2007 2:59 am

Post by Gerald sui »

First,ray,Thanks for your reply.

Maybe I am not explian clearly.Let me take one Example.I want to calls up script MyScript.sh in one Exec_Command_AAA activity,and pass password $CMDW_DB2_PASSWORD(it's a Env Variable) to script MyScript.sh .Then I need switch to ExecCommand tab in activity Exec_Command_AAA. And specify the following things

Command
ksh
Parameters
#$CMDW_UTILITY_FILE_ROOT#/MyScript.sh #$CMDW_DB2_PASSWORD#

Then in this sequence job's job log,Will display the below information.
ETL_XXX..JobControl (@Execute_Command_AAA): Executed: ksh /home/dsdev2/r60_PCR173/dsutil/ag/MyScripts.sh dsadm

Notes:dsadm is the value of env variable $CMDW_DB2_PASSWORD.

Thank you so much for any reply[/img]
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

You might want to check if the type for $CMDW_DB2_PASSWORD is set as encrypted in the administrator itself.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Don't pass it on the command line. Access it within the script.

Code: Select all

dsjob -user gerald -password $CMDW_DB2_PASSWORD -run -jobstatus $1 $2
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply