When typing password in bash asterisk is displayed; how do I change it [Solved]

Forum rules
Before you post please read how to get help
Post Reply
Gara3987
Level 1
Level 1
Posts: 34
Joined: Mon Mar 09, 2009 7:15 pm

When typing password in bash asterisk is displayed; how do I change it [Solved]

Post by Gara3987 »

This is from a fresh install of Linux Mint 19.2. I looked through `/etc/sudoers' and the file is populated with :

Code: Select all

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/
sbin:/bin:/snap/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
I would like to set it to where nothing is displayed.

Thanks in advance for the assist.
Last edited by Gara3987 on Sun Sep 01, 2019 1:57 pm, edited 1 time in total.

User avatar
freekvb
Level 1
Level 1
Posts: 10
Joined: Thu Jan 26, 2017 3:47 pm

Re: When typing password in bash asterisk is displayed; how do I change it

Post by freekvb »

Code: Select all

sudo visudo
add pwfeedback

Code: Select all

Defaults        env_reset, pwfeedback
Last edited by freekvb on Sun Sep 01, 2019 9:49 am, edited 1 time in total.
there's no business like .. your own business ..

User avatar
xenopeek
Level 24
Level 24
Posts: 24656
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: When typing password in bash asterisk is displayed; how do I change it

Post by xenopeek »

At the very end of the sudoers file (edit with sudo visudo) add the line:
Defaults !pwfeedback

Log out and back in and password prompt should no longer show stars on the terminal.
Image

Gara3987
Level 1
Level 1
Posts: 34
Joined: Mon Mar 09, 2009 7:15 pm

Re: When typing password in bash asterisk is displayed; how do I change it

Post by Gara3987 »

Thanks for the help; I found the issue. Editing the `sudoers` file didn't help; however, I found a file in the `/etc/sudoers.d/` labeled `0pwfeedback` which was a read only file. The contents were :

Code: Select all

Defaults	pwfeedback
I changed the file to read and write and edited the contents within to :

Code: Select all

Defaults	!pwfeedback
Which corrected the issue. I changed the file back to read only. I know I could have just removed the file completely, though I felt it would be a good experience to learn from this by modifying the file.

Thanks again for the help.

Post Reply

Return to “Scripts & Bash”