Summery: In this article you will learn how to display asterisks when typing sudo password in Linux terminal.

Usually, when you type a password in an application it displays a feedback using asterisks (*). But on the Linux terminal when a normal user starts typing a password to gain superuser privileges he/she won’t get any type of visual feedback on the terminal.

This is a built-in security mechanism used in Linux terminals so that no one can predict your password length. This mechanism will increase the chances that you may mess up with your password by entering it wrongly.

In this tutorial, I’ll guide you on how to display asterisks when typing your password in the Linux terminal.

  • Open your terminal and type the following.
sudo visudo

You will get an output like this.

sudo visudo
sudo visudo

Also Read: How to Install ZSH Shell on Ubuntu

  • Search for the following line.
Defaults        env_reset
Search for Defaults env_reset
Search for Defaults env_reset
  • Append “pwfeedback” to the end of the line.
Defaults        env_reset,pwfeedback
Append "pwfeedback"
Append “pwfeedback”
  • Press Ctrl + X to complete the edit and select Y to save the changes.
  • Close the terminal window and open it for the change to take place.


  1. Make sure to backup /etc/sudoers file before making any changes.
  2. Please be aware that the other users can predict the password length if they see the password when you type it. 

Make sure to visit this site frequently so that you will never miss a post. Thank you.


Leave a Reply

Your email address will not be published. Required fields are marked *