Updated: 28 September 2026 · Applies to: AlmaLinux 9, Rocky Linux 9, Ubuntu 24.04 and Debian 12
By default, sudo shows nothing while you type your password. You can make it show asterisks.
Steps
- Open the sudoers file safely:
sudo visudo. - Add (or extend) the
Defaultsline:Defaults pwfeedback
- Save and exit.
Note: Always use visudo: it checks the syntax, and a broken sudoers file can lock you out of sudo. Asterisks reveal the password length to anyone watching your screen.