Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

How to Show Asterisks While Typing Sudo Password in Linux?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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.

My Personal Notes arrow_drop_up
Last Updated : 16 Feb, 2021
Like Article
Save Article
Similar Reads
Related Tutorials