9

When asked to type my password to run a sudo command, the USB keyboard goes unresponsive and I cannot type in the password or anything else.

I can hit return three times to bounce out on three failed password attempts however so it gets the return key input but no other keys until I bounce out then all works again.

Any suggestions?

28

The terminal doesn't show the characters being entered when typing in a password field such as a sudo password field. The characters are still being entered—just type your password as normal and press Enter to continue.

$ sudo echo hi
Password: type here, then enter
hi

You can show asterisks when entering your password for sudo by editing the sudoers file.

  1. Open /etc/sudoers with visudo:

    EDITOR=nano sudo visudo
    

    I've used nano here, but feel free to use your preferred editor.
    visudo will check your file for errors before saving, otherwise you may not be able to sudo.
    You can backup the file with cp /etc/sudoers ~/Desktop.

  2. Add "pwfeedback" to the Defaults, replacing the first line with the second:

    Defaults env_reset
    
    Defaults env_reset,pwfeedback
    
$ sudo echo hi
Password: ************
hi
  • 3
    It would be a good idea if your instructions included making a backup of etc/sudoers before attempting to edit the file. – fd0 Aug 15 '15 at 12:02
  • 1
    @fd0 Considering that visudo is being used, a corrupt sudoers will be rejected upon saving. – hexafraction Aug 18 '15 at 18:45
  • @hexafraction visudo checks syntax and rejects improper syntax. There is an instance where the edit can render sudo inoperable. I suggest that you have a look at the manual. As "good practice" any config file should be backed up before editing. I save the backup in the same location as the config file that I'm editing, such as, sudo cp /etc/sudoers /etc/sudoers.orig – fd0 Aug 20 '15 at 11:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .