0

I'm using Ubuntu 22.04 on my laptop, on my PC is normal but with my laptop, everytime I input password for sudo it was showing on screen.

enter image description here

I trying to edit in visudo but my password still showing on screen

enter image description here

Edit:

I follow your guys and typing "type -a sudo" then get this result

sudo is /usr/bin/sudo sudo is /bin/sudo

Notes: pwfeedback was not at visudo in the first time, I was read some password problems and I tried to write it into visudo. I removed it few minutes ago and it still showing sudo password.

4
  • 1
    Remove pwfeedback from the sudoers file ... That is something you added and not there by default and it means what it says "Password Feedback" ... It should be asterisks * though, so you probably modified something else ... Do you recall what it was?
    – Raffa
    May 31, 2023 at 14:11
  • @steeldriver Nice point ... Might be a password helper program indeed.
    – Raffa
    May 31, 2023 at 14:22
  • 1
    That is interesting ... Please, edit to add the output of sudo --version and the output of strace sudo and the output of ldd /bin/sudo
    – Raffa
    Jun 1, 2023 at 4:19
  • 1
    I can reproduce this (Ubuntu 22.04 VM, sudo version 1.9.9) by enabling visiblepw and then invoking sudo in an environment that does not allocate a TTY ex. ssh localhost sudo sudo -l. The cleartext password appears to be echoed regardless of whether pwfeedback is enabled. Jun 1, 2023 at 12:29

1 Answer 1

6

Edit the sudoers configuration file with:

sudo visudo

and remove ,pwfeedback as this enables the password feedback i.e. indicator characters in the terminal which are usually asterisks * ... Plain text however is not enabled by that so you probably changed something else as well.

Making sudo print the plain text password in the terminal is not possible as well AFAIK.

What you might have masking your settings in the sudoers configuration file is likely an intermediate(between the user and /bin/sudo) password helper program, an executable shell script in your search path or even a shell function like this one:

sudo () 
{ 
    read -r -p "[sudo] password for ${USER}:" my_pass;
    echo "$my_pass" | /bin/sudo -S "$@"
}

You can find out which is which by running in your terminal:

type -a sudo

You must log in to answer this question.

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