Ubuntu Tips – Display Asterisks When Typing Your Password in Terminal

Last updated: August 8, 2014

Display Asterisks when typing password

When you run a command started with sudo in Ubuntu terminal, it asks you to insert the password for your user with no visual feedback as you type.

For beginners who feel uncomfortable with this terminal feature, below will teach you how to tweak your Ubuntu so that Gnome terminal (and TTY console) displays asterisks when you type in your password.

Terminal with password feedback by displaying asterisks

1. Press Ctrl+Alt+T on keyboard to open a terminal window. Or open terminal from Unity Dash.

2. Paste the below command in terminal and hit enter. Type in your password when prompt.

sudo visudo

It will open the configuration file “/etc/sudoers” in terminal with nano editor.

3. Make a new line:

Defaults        pwfeedback

under the line:

Defaults        env_reset

So it looks like this: (NOTE that the space between Defaults and pwfeedback should be a tab)

4. Now save the changes. Press Ctrl+X, type y to answer yes, press Enter to accept default file name.

Close this terminal window and done.

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1 |

2 responses to Ubuntu Tips – Display Asterisks When Typing Your Password in Terminal

  1. Hi Ji m, thanks for the blog. The above is a bad security practice, and I suggest you make a clear warning. Echoing asterisks gives away information: 1) Password length, and 2) Making it easier to video-tape keypresses by syncing them with screen feedback.

  2. For security reasons it is not so good, but for home PC it is much better and comfortable.