-2

When entering a password into the password field in a Linux terminal- the password is just in the clear!

This is a commonly known fact.

But what if I'm in public, like in an office, and need to enter my password, regardless of the reason, but that annoying colleague is just staring at my screen, waiting!?

Couldn't the developers have made some kind of feature that works something like: press Ctrl+*, and then whatever I type next is obscured by bullet points or asterisks?

Is the reason that something like this isn't implemented into the terminal because:

  1. The devs didn't think of this (unlikely)?
  2. There's a reason why this can't be implemented into terminals?
  3. They just don't see the need?

Because personally, although this isn't a common occurrence, I feel pretty uncomfortable whenever I have to do it in public!

Now, there are many tools that people have made to help with this, such as:

https://stackoverflow.com/questions/55766607/hiding-password-field-in-command-line

And

https://www.tecmint.com/show-asterisks-sudo-password-in-linux/

But, the thing is, these require installed tools, which I wouldn't have a problem with installing, but what if I am using a work system that doesn't allow or want unauthorized programs installed. Also, the general gist I am getting with these programs is that some of them require you to pre-enter your password into them, which poses even bigger security flaws.

But I am asking this question because I want to know why something like the Ctrl+* feature isn't around, as implementing something as small as this seems like it would have such a big benefit, I think.

As a side note, Adam Katz talks about a 9-bullet-point-password, where obscurity would come in handy. Maybe in this case, and this case only, I might take their suggestion up!!

2
  • 2
    "This is a commonly known fact." Really? Provide an example...
    – schroeder
    Commented Jun 3 at 12:01
  • 1
    That nine-bullet password concept was not a suggestion! Instead, stop using whatever program is displaying your password. If it's your posix/bash shell script, consider something like stty -echo; read -r password; stty +echo to hide the entry.
    – Adam Katz
    Commented Jun 3 at 15:28

1 Answer 1

4

When entering a password into the password field in a Linux terminal- the password is just in the clear!

This claim is simply not true. The normal password prompts in SSH or at the console do not show the entered password. Instead they show nothing by (temporarily) setting "echo off" in the tty settings.

https://stackoverflow.com/questions/55766607/hiding-password-field-in-command-line

This question does not refer to entering the password "in the password field in a terminal" but is about specifying the password (in clear) as a command line argument. This has nothing to do with the terminal but is how the specific command expects its parameters.

Since it is often not a good idea to provide the password directly on the command line, many commands actually have ways to specify a password without writing it in clear on the command line - like reading it from a file, reading it from a file descriptor, reading it from the terminal (with echo off) etc. They sometimes offer a command line option though, so that it can be used for scripting.

In the case of the referred questions it was about some unspecific "compression_bin" where the encryption password was specified on the command line. But tools handling encryption like zip or gpg usually don't expect the password on the command line at all - instead they ask with echo off on the terminal.

https://www.tecmint.com/show-asterisks-sudo-password-in-linux/

This question is also not about entering the password in "clear", but instead about replacing the current "don't show anything" (echo off) with "show asterisk instead".

4
  • Thanks very much for your answer. Firstly, I would prefer to have asterisks or bullet points over blank (echo off) because at least then you can see how long it is, and also, I’d have a problem with storing my password in a text file because it doesn’t seem to secure. But I guess echo off is definitely better than nothing- do you happen to know if you can set a shortcut for echo off? Commented Jun 3 at 6:11
  • I will close my question if you deem it a silly one. Thanks. Commented Jun 3 at 6:14
  • 1
    @security_paranoid: "I would prefer to have asterisks or bullet points over blank" - personal preference unrelated to security is not what your question is about. "set a shortcut for echo off" - this is a setting done by the program for the specific moment the password is asked for. If you want to create some script asking for a password you can use stty -echo for disabling echo and the stty echo for enabling it again. Commented Jun 3 at 6:15
  • Thanks. I will try. Commented Jun 3 at 6:18

Not the answer you're looking for? Browse other questions tagged .