How to Display Asterisks as You Type in a Sudo Password in LINUX?

How to Display Asterisks as You Type in a Sudo Password in LINUX?

In most applications, asterisks (*******) display feedback when the user is typing a password. But in a Linux terminal, if you run the sudo command as a normal user to gain superuser privileges. The user is asked for a password, but the screen remains blank while they type.

Here we are going to see about Ways to fix the feedback of asterisks when you enter password in the terminal—a handy trick for Linux users.

What is LINUX Operating System?

Linux is a software platform that can be used to run, among other things, smart household appliances and Internet of Things (IoT) devices. It runs on major computer platforms, including x86 (a central processing unit), ARM (commonly used in mobile devices like smartphones and tablets) and SPARC.

Like any operating system, Linux is used to manage hardware resources, launch and handle applications—and provide some form of the user interface. Because of the large number of developers creating Linux programs, there's a version available for almost every task.

Why do we need Passwords?

Securing your password is an important activity whereas it acts forward to cybercriminals also accessing your data unauthorized can be very difficult. Most people around the world struggle with managing their passwords. The stronger your password, helps to protect your details and data from malicious software and hackers. You should keep secured password in all the accounts you have.

How to enable the password feedback feature?

The feature of password – feedback enables the /etc/sudoers by editing and restoring a backup copy of that file.

$ sudo cp /etc/sudoers /etc/sudoers.bak
$ sudovisudo
Start locating the lines mentioned below:

Defaults env_reset
And you should add feedback to it so it will look like this.

Defaults env_reset,pwfeedback
To save and close the file, press Esc and type:wq. If you are using nano editor, though, use Ctrl+x to exit followed by "y" (to confirm), then ENTER.

Then type the command below into your terminal to reset it for the above changes.

$ reset
You should now see visual feedback—a masking asterisk (*) in this case—

$ sudo yum update
Privacy is incredibly important in today's technological world of constant surveillance and identity theft. The feedback feature in password fields helps you keep your passwords more secure by showing asterisks as you type to mask the characters when someone else is looking over your shoulder. Follow the discussed process to enable the feature.
First release
Last update
0.00 star(s) 0 ratings

More resources from kumkumsharma