Hacker News new | ask | show | jobs
by didsomeonesay 608 days ago
.. and now the password is stored unencrypted in your bash history.
3 comments

Use the `read` method the other poster said, or ensure HISTCONTROL is set and then prepend a space to commands that contain secrets.

  $ export HISTCONTROL=ignoreboth
  $  echo 'supersecret' | whatever
That's a feature, not a bug. :P

Alright if you prefer:

    read PW; sleep 3; xdotool type "$PW"
Or if it's already on your clipboard:

    sleep 3; xdotool type "$(xclip -o)"
Prefix any command with a space and bash won't append to the history.
Careful that's only true if you set HISTCONTROL to "ignorespace" or "ignoreboth".
Which seems the default in my anecdotal experience on debian/Ubuntu.

It is also the default on fish shell in the same anecdotal experience.