Sudo Password Asterisks in the Terminal Window

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
User avatar
Misko_2083
Level 1
Level 1
Posts: 23
Joined: Mon Jan 12, 2015 10:17 am

Sudo Password Asterisks in the Terminal Window

Post by Misko_2083 » Tue Sep 26, 2017 3:32 pm

PLEASE READ THIS FIRST:
Echoing asterisks gives away information:
1) Password length, and
2) Makes it easier to video-tape keypresses by syncing them with screen feedback. ;)

We will open the /etc/sudoers file and change a setting.
IMPORTANT: Use extreme caution when editing /etc/sudoers file. Never edit the sudoers file with a normal text editor (leafpad,gedit,mousepad..).
Always use the visudo command as described here. If the sudoers file has improper syntax, you will be left with a system where it’s impossible to obtain elevated or root privileges. The visudo command opens a text editor like you would with normal text files, but the command also validates the syntax of the file upon saving it.This prevents configuration errors in the sudoers file from blocking sudo operations, which could be your only method of obtaining root privileges.

Press Ctrl + Alt + T (or use the menu) to open a Terminal window and type in

Code: Select all

sudo visudo
Use the arrow keys on your keyboard to move the cursor to the end of the following line:

Code: Select all

Defaults         env_reset
Change the line by adding ,pwfeedback to the end of the line.

Code: Select all

Defaults                 env_reset,pwfeedback
Image

Another way to do it (choose one of them):
You can also press Enter after env_reset to make a new line and type the following on the new line:

Code: Select all

Defaults                 pwfeedback
NOTE: The space between Defaults and pwfeedback should be a tab.
When you type in Defaults press TAB key on your keyboard to add space and then type in pwfeedback
Image

Once you're done editing press Ctrl + O to write out the changes.
You will be asked for the File Name to Write at the bottom. Press Enter to accept the default.
When it's saved Press Ctrl + X to close the nano editor.

Now type in

Code: Select all

sudo -k
That will invalidate the user's cached credentials. In other words, the next time sudo is run a password will be required.

Finally type in

Code: Select all

sudo su
Image

Post Reply

Return to “Tutorials”