sudo and password feedback

In Lucid, there is a new version of sudo that allows you to do something useful (and long-awaited).

With the correct configuration, you can now have sudo show an asterisk (*) when you type a letter (just like any other password entry).

Screenshot of sudo with password feedback enabled

This makes it a lot easier both for new users who expect some kind of visual feedback when they type, and anyone who can’t remember whether they pressed that key or not 🙂

I realise some people will say “oh no! What a security risk”, however in my opinion, it is only a star you are seeing and if you have a strong enough password, having a person see the number of stars is not really going to matter, it is the same as when you enter your password for PolicyKit.

The steps to do it are simple, however make sure you pay attention to them!

  1. Open a Terminal (Applications>Accessories>Terminal) and type in:
    sudo visudo
  2. Type your password in (you won’t see any visual feedback, yet!) and click Enter
  3. Now, find the line that reads:
    Defaults env_resetAnd replace it with:

    Defaults env_reset,pwfeedback

  4. Finally press Ctrl-X, press Y and then press Enter (or if you have changed your default text editor, just save the file as usual)
  5. sudo should now be set up correctly, open up a new Terminal and try it out:
    sudo echo "It works!"

If at the end, you receive a message saying something like

'>>> /etc/sudoers: syntax error near line 8 <<<'

Then press X, then Enter and leave a comment below (it didn’t work)

3 responses to “sudo and password feedback

  1. Valdur55

    sudo echo ‘It works!’ is better than sudo echo “It works!”
    Whit ‘ can get some normal output

  2. Pingback: Feedback When Typing Password At A Sudo Prompt | Click & Find Answer !

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: