Score:0

My sudo password was completely showing on my terminal - Ubuntu 22.04

nu flag

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.

Raffa avatar
jp flag
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 avatar
jp flag
@steeldriver Nice point ... Might be a password helper program indeed.
Raffa avatar
jp flag
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`
hr flag
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.
Score:6
jp flag

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
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.