How to Show Asterisks While Typing Sudo Password.

How To Show Asterisks While Typing Sudo Password.

In this article, we are going to see how to display asterisks as feedback when you type the password in the terminal in Linux. Here the user has invoked the sudo command to install vim text editor, but the Asterisks are not shown here when the user typed a password.

The password feedback feature can be enabled in the /etc/sudoers file but after creating a backup of the file, open it for editing using the visudo command.

$ sudo cp /etc/sudoers /etc/sudoers.bak
$ sudo visudo

Now search for the following line.

Defaults env_reset

And user must append pwfeedback to it so that it looks like this.

Defaults env_reset,pwfeedback

To save and close the file press ESC key and type : wq 

If the user is working on a nano editor press “Ctrl + x” to save the file and then press “y” followed by entering to close the file. To reset the terminal for the above changes run the below command.

$ reset

Now user can see Asterisks every time the user type’s a password in terminal.