How to Show Asterisks While Typing Sudo Password in Linux?

Most applications normally display a feedback using asterisks (*******) when a user is typing a password, but on the Linux terminal, when a normal user runs the sudo command to gain super user privileges, he/she is asked for a password, but no visual feedback is seen by the user while typing the password.


Take a look at the following screenshot, here the user rootadminz has invoked the sudo command to install the vim text editor in CentOS 7, but there is no visual feedback as the password is typed (in this case the password has already been entered):

$ sudo yum install vim


You can enable the password feedback feature in /etc/sudoers file, but first create a backup of the file, then open it for editing using the visudo command.

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


Search for the following line.

Defaults env_reset


And append pwfeedback to it, so that it looks like this.

Defaults env_reset,pwfeedback


Now press Esc key and type :wq to save and close the file. But if you are using nano editor, save the file by hitting “Ctrl+x” and then “y” followed by “ENTER” to close it.


Then run the command below to reset your terminal for the above changes to start working.

$ reset


That’s it, now you should be able to see a visual feedback (****) every time when you typing a password on the terminal, as shown in the following screenshot.

$ sudo yum update


  • sudo command
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

System Requirements

Most current web servers with PHP & MySQL installed will be capable of running WHMCS. The...

Common logs file paths

Log files are helpful in troubleshooting issues and in monitoring the performance of cPanel...

Disable ModSecurity in cPanel

What is ModSecurity?Mod_security is an apache module that helps to protect your website from...

How to disable directory listing in cpanel?

Disable directory listing in cpanelIndex Manger in cPanelThe Index Manager allows you to...

How to disable the listing in a non-cPanel CentOS server?

How to disable the listing in a non-cPanel CentOS server?1. Locate your httpd.conf file. Normally...