How to see asterisks while typing password in terminal?

See asterisks in linux terminal

Most of us we are used to the fact that in applications mobile phones or web applications that we use in our daily lives show dots or asterisks when we enter credentials login in the password field.

Esto it is for simple security reasons, to prevent someone else from seeing our access data in plain text. There are even browsers that give you the possibility of being able to save your access data of your visited websites in order to save you time and give you comfort.

Security or discomfort?

Although in the past these access data were saved within a database which was very easy to access or that even the same browser (Chrome, Firefox, Opera, etc.) could show you the saved passwords.

This has changed over time and now they usually use an access token where when accessing your page where you put your credentials those Asterisks or points are still shown. This is definitely a good basic security measure.

However on Linux it's totally different only a true Linux user will understand the capabilities of the Linux operating system.

When using the terminal, you may have noticed that when a normal user executes the command sudo to get superuser privileges, you are prompted for a password, but the user you do not receive visual feedback while entering the password.

This is usually one of the biggest and most common problems newcomers to Linux get when they first interact with sudo. And it is something that we must admit because it happened to all of us.

Since when wanting to elevate the privileges it is difficult to identify if something is being written or not. Also, there are no visual comments to notify them if something is being written or not.

This becomes a nightmare because you think that nothing is happening.

How to enable asterisks for passwords in the terminal?

Although for users who already know that nothing is shown when typing a password on the terminal this does not represent any problem and we get used to it over time.

For newcomers, it may mean that they decide to return to their previous system if they do not find help at that moment when they are interacting with a terminal for the first time.

It is because of that we can make a configuration in our system to be able to show those asterisks when we write a password.

Many may say that it is irrelevant or unnecessary, but for those people who are computer technicians, IT administrators or who have clients, friends or family to whom they recommend Linux, this can help a lot.

It is because of that we must make a previous configurationBecause we must make a backup copy of our sudoers.

The file is in the following path: etc / sudoers

To do this we must open a terminal Ctrl + Alt + T we are going to execute the following command to make our backup:

sudo cp /etc/sudoers /etc/sudoers.bak

The backup is done, Yes now we can proceed to open it for editing by executing the command:

sudo visudo 

This command will open the file for editing. Once it is opened, find the line that contains the default env_reset attribute.

visudo-2

And VWe masters to append pwfeedback on it.

It should be as follows:

Defaults      env_reset, pwfeedback

Once this is done, we can save the changes with the key combination Ctrl + O and exit the edition with Ctrl + X.

For the changes to be effective, they just have to close the terminal and reopen it. To see what worked, let's run a

sudo apt-get update

And when we are writing the password we must already see the asterisks. With this we already have this simple configuration enabled that will be very useful to newbies and people who do not know about Linux or who do not even want to know that they are using it.


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.