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

  1. Open the sudoers file safely: sudo visudo.
  2. Add (or extend) the Defaults line:
    Defaults pwfeedback
  3. 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.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket