Feature request (unless this is already possible)


When I change a password, I have to put the old and new password in clear text in the command. Could it be possible to prompt the user to enter the old and new password instead? This way, the password values wouldn’t be left behind in the shell history.

sensuctl user change-password …

Hey there @KendallChenoweth :wave:

This is already possible using the --interactive flag:

$ sensuctl user change-password --interactive
? Current Password:      **********
? New Password:          **********
? Confirm Password:      **********

For future reference, the --help documentation in sensuctl is quite comprehensive, including docs for sub-commands (e.g. sensuctl user --help or sensuctl user change-password --help). I find the help output usually has what I’m looking for in cases like this. I had to double check to make sure we weren’t missing this one, but it is there (the --interactive flag is documented):

$ sensuctl user change-password --help
change password for given user

Usage:  sensuctl user change-password [USERNAME] [flags]

      --current-password string   current password
  -h, --help                      help for change-password
      --interactive               Determines if CLI is in interactive mode
      --new-password string       new password

Global Flags:
      --api-url string             host URL of Sensu installation
      --cache-dir string           path to directory containing cache & temporary files (default "/home/calebhailey/.cache/sensu/sensuctl")
      --config-dir string          path to directory containing configuration files (default "/home/calebhailey/.config/sensu/sensuctl")
      --insecure-skip-tls-verify   skip TLS certificate verification (not recommended!)
      --namespace string           namespace in which we perform actions (default "default")
      --trusted-ca-file string     TLS CA certificate bundle in PEM format

I hope this helps!

PS: …thanks for posting these questions in Discourse (vs Slack). Very helpful for future users! :smile: