Make Sudo Command Passwords Visible in the Terminal

All Linux users must have had the experience of having to enter their password whenever they use sudo on Ubuntu. It’s how the terminal works and we’re used to it. It’s also a good thing because it is a great security measure.

But the thing is: the terminal doesn’t display any sort of visual hints or feedback as users type in their password and this can be confusing for new users, who are often left uncertain as to whether their keyboards have data entry issues when using the terminal or not.

When users finally get to understand that the absence of any such feedback is by design they move on with life and accept it as the Ubuntu way.

But – if you are one who likes to receive at least visual feedback then there is no reason why you shouldn’t. If you would prefer to see a few traditional asterisks displayed as you enter each keystroke, then we have a quick guide on how to make things that way, for you.

 

  1. Open a new Terminal window (Ctrl + Alt + T) and enter the following command:
    sudo visudo
  1. Use your keyboard navigation keys (or mouse scroll wheel) to move to the line that reads:
    Defaults env_reset

Move the square box to the end of this line and add the following text so that it reads:

Defaults env_reset,pwfeedback

 

  1. Press Ctrl + Xto complete the edit, followed by Y and Enter/Return to save the changes entered

 

That’s all there is to it. The next time you use sudo you’ll see pretty little asterisks appear as you enter your password and now, no matter how fast or slow you type, you wouldn’t be confused as to how many keystrokes you have entered when you enter your password

About The Author
Okoi Martins Jr.
I'm a Computer Scientist with a passion for learning new things in fields ranging from theoretical implications of computer science and mathematical modeling to web development and music. In my spare time, I listen to music, read like a compiler, and learn like an A.I algorithm.

Leave a Response