Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Display Asterisks When You Type Password In terminal  (Read 1496 times)

0 Members and 1 Guest are viewing this topic.

akhilt

  • Guest
Display Asterisks When You Type Password In terminal
« on: February 17, 2018, 03:24:29 pm »
When you type passwords in a web browser login or any GUI login, the passwords will be masked as asterisks like ******** or bullets like •••••••••••••. This is the built-in security mechanism to prevent the users near you to view your password. But when you type the password in Terminal to perform any administrative task with 'sudo' or 'su', you won’t even the see the asterisks or bullets as you type the password. There won’t be any visual indication of entering passwords, there won’t be any cursor movement, nothing at all. You will not know whether you entered all characters or not. So, inorder to display asteriks while typing the password in terminal, we need to make a small modification in “/etc/sudoers” file. Before making any changes, it is better to backup this file. To do so, just run:

Code: [Select]
sudo cp /etc/sudoers{,.bak}
The above command will backup /etc/sudoers file to a new file named /etc/sudoers.bak. You can restore it, just in case something went wrong after editing the file.

Next, edit “/etc/sudoers” file using the command:

Code: [Select]
sudo visudo
Find the following line:

Code: [Select]
Defaults env_reset
Add an extra word “,pwfeedback” to the end of that line as shown below.

Code: [Select]
Defaults env_reset,pwfeedback
Then, press “CTRL+x” and “y” to save and close the file. Restart your Terminal to take effect the changes.
Now, you will see asterisks when you enter a password in Terminal. ;) ;) ;)