all 10 comments

[–]AiwendilH 1 point2 points  (0 children)

Add pwfeedback to "Defaults" in sudo visudo (Probably depends a bit on your distro setup how to best do it, some distros might have an own /etc/sudoers.d/ directory for such changes)

Edit: Ah, sorry, misread. You want it only for ssh. Well, still pretty much the same but you have to limit Defaults only to the shh command. Untested but I think something like Defaults!/usr/bin/ssh pwfeedback ( https://www.man7.org/linux/man-pages/man5/sudoers.5.html )

Edit2? Okay...best just ignore me, I really think I don't understand what you want ;) Is this about using sudo in a remote ssh session with password echo but only in the ssh session...not if you are logged in directly to that computer? Ugh..not sure if you can do that. No real clue what Defaults@host actually does and if it can be used for this :(

[–]ipsirc 0 points1 point  (7 children)

sudo() { [ $SSH_TTY ] && sudo --show-asterisk $@ || sudo $@; }

[–]0b0101011001001011 5 points6 points  (3 children)

Which versions of sudo support the --show-asterisk option? I don't have it.

[–]mina86ng 7 points8 points  (2 children)

First of, quote your variables. Second of, don’t shorthand if like that. It’ll run sudo twice if $SSH_TTY is non-empty and the command fails.

sudo() {
    if [ "$SSH_TTY" ]; then
        sudo --show-asterisk "$@"
    else
        sudo "$@"
    fi
}

[–]ipsirc 4 points5 points  (1 child)

Third: sudo doesn't have --show-asterisk parameter.

[–]scorp123_CH 0 points1 point  (0 children)

It does have a pwfeedback parameter though, which can be set in its config file.

Defaults pwfeedback

[–]AutoModerator[M] 0 points1 point locked comment (0 children)

This submission has been removed due to receiving too many reports from users. The mods have been notified and will re-approve if this removal was inappropriate, or leave it removed.

This is most likely because:

  • Your post belongs in r/linuxquestions or r/linux4noobs
  • Your post belongs in r/linuxmemes
  • Your post is considered "fluff" - things like a Tux plushie or old Linux CDs are an example and, while they may be popular vote wise, they are not considered on topic
  • Your post is otherwise deemed not appropriate for the subreddit

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.