Skip to content

How to use --password-stdin flag

There are various ways to use the --password-stdin flag

  • Prompting For Password
  • Passing Password via Piping with the --password-stdin Flag

Prompting For Password

When utilizing the --password-stdin flag, you will be prompted to enter the password via standard input at the command line, displayed as Enter password:.

NOTICE

The password you enter will be masked for security.

$ iectl config add <iehub\iem\ied\iem-os> \
        --name "configname" \                                   # name of the configuration being added in lower case
        --url "https://iehub.eu1-int.edge.siemens.cloud/" \     # URL of IEHUB on which you want perform operations. Provide URL without hub name, e.g.: https://iehub.eu1.edge.siemens.cloud   
        --user "user_email_address" \                           # accepts email address used for IEHUB login 
        --password-stdin   \                                    # set password from stdin for login

Passing Password via Piping with the --password-stdin Flag

You can also pass the password securely through standard input (stdin) by piping it directly into the command. This method avoids exposing the password in the command line history or as an argument.

$ cat ~/my_password.txt | iectl config add <iehub\iem\ied\iem-os> \
        --name "configname" \                                   # name of the configuration being added in lower case
        --url "https://iehub.eu1-int.edge.siemens.cloud/" \     # URL of IEHUB on which you want perform operations. Provide URL without hub name, e.g.: https://iehub.eu1.edge.siemens.cloud   
        --user "user_email_address" \                           # accepts email address used for IEHUB login 
        --password-stdin        \                               # set password from stdin for login