Enable password asterisk in Linux

Tags: Linuxpasswordsudo

Published on: November 2, 2015 by Manu M.

Enable password asterisk in Linux


Hello folks, I am writing this blog because I came across a cool tweak for my Linux distro to enable Linux password asterisk

This is for all people who makes typos regularly, which can become frustrating when this happens while typing in your password. This becomes hell when you are putting your password into a console, where you don’t even know if you have entered all the keys.

I always get irritated with this, as like all typos out there, I make mistakes many a time and the console tells me that I have entered a wrong password. Now come on, how do I even know if I have entered the complete password?

Well Linux is one such console which doesn’t show the password as you type them.  Although Linux boasts this as one of their security technique, most of us don’t want this in our life. Jokes apart, I have found a tweak to override this.

Even though this is not much, but at least this tweak will show us the password as asterisk as we type them in (yes, like in Windows). So at least you can count the number of characters entered 🙂

So, What are we trying to do here?

When you run a command using sudo in Linux, the Terminal prompts you to type in your password with no visual feedback. Here I will show you a tweak that will show asterisks (*) when you type in your password in the Terminal.

Before Tweak

kb scr1

After Tweak

kb scr2

How to do this?

For enabling the Linux Password Asterisk here we are going to open the file “/etc/sudoers” and customize it.

Run following command.

sudo visudo

Now the file is open and search for following

Defaults       env_reset

Now edit it to look like

Defaults           env_reset,pwfeedback

or in the next line add following

Defaults          pwfeedback

save the file. Close the terminal and open it again and try running any commands that asks you for password. While you type in the password you can see the asterisks showing up.

Don’t edit /etc/sudoers file directly in any other editor. run sudo visudo to edit it.

Get 24/7 expert server management

Category : Howtos, Linux

Manu M.

Manu M.

Manu has been with us for past one and half years and is a person with good technical skills and domain knowledge. Being a highly athletic personality, Manu likes to play Cricket and Badminton of all games whenever he gets time off. Apart from his technical and athletic abilities, he is a good writer and has tried his hands on penning a few poems of his own. He believes in the mantra that "small things matter the most" and this nature can also visible in his blogs and writings.

You may also read:


Add new commentSIGN IN

Let's Connect


Your Cart

Cart is empty.

Send this to a friend