When I ssh into my CentOS 7 machine and try to use sudo, I'm unable to submit my password.

Example prompt:

$ sudo ls
[sudo] password for edwardloveall: 

Then I type my password, hit Enter, and nothing happens. No, command is run (seemingly), no "Sorry, try again.", no nothing. I am forced to Ctrl+C out of the prompt and do something else. This failure also happens when entering an ssh key password.

Return is accepted for other non-sudo commands and prompts. This behavior used to work, and as far as I know the system was not updated.

How can I fix or troubleshoot this?

Edit: Some more output to debug with:

$ id
uid=1000(edwardloveall) gid=1000(edwardloveall) groups=1000(edwardloveall),10(wheel)
$ ls -l /etc/sudoers
-r--r-----. 1 root root 4188 Mar 31  2016 /etc/sudoers

Also tried su -c date, attempted to enter a password (not sure if I had the right one) but the same thing happened: no response at the prompt.

More debug info:

$ hostname
$ cat /etc/hosts

... snip comments ... portfolio portfolio localhost.localdomain localhost localhost4.localdomain4 localhost4

# The following lines are desirable for IPv6 capable hosts
::1 portfolio portfolio
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6


I did find a workaround, if i hit Ctrl+D after entering my password it seems to let sudo work. I'd rather have Enter work however.

Fix (sortof)

I found a better work around.

If I edit my /etc/sudoers configuration (via visudo) and change

Defaults    env_reset


Defaults    env_reset,pwfeedback

Then * appear when I'm typing my password, and enter works! Changing it back has the same enter-not-allowed effect as before. If anyone knows why this works, I'd love to know.

  • Could you post output of commands: id and ls -l /etc/sudoers. Can you execute su -c date (it requires your root password if exists, not the edwardloveall user)? – Bob Jul 29 '18 at 3:11
  • @bob Updated with suggested output – Edward Loveall Jul 29 '18 at 12:37
  • Have you changed your hostname recently? Check and post output of: hostname and cat /etc/hosts. – Bob Jul 29 '18 at 12:54
  • Sure thing. I'm pretty sure that hasn't changed recently. Certainly not by me. – Edward Loveall Jul 29 '18 at 20:42
  • Try to reinstall sudo package: yum reinstall sudo – Bob Jul 30 '18 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.