How to make Debian 13 GNOME `sudo` show asterisks when typing password?
Sep 19, 7:06pm

To make sudo show asterisks (*) when typing your password in Debian 13 (Trixie) with GNOME, you need to configure pam (Pluggable Authentication Modules) to enable password echo. Here's how:


âś… Step-by-Step Solution

1. Edit the PAM configuration for sudo

Open the PAM configuration file for sudo in a terminal:

bash
sudo nano /etc/pam.d/sudo

2. Add or modify the pam_unix.so line

Find the line that starts with:

text
auth    include system-auth

or

text
auth    sufficient pam_unix.so

Replace it with:

text
auth    sufficient pam_unix.so echo=*

🔹 This tells PAM to echo asterisks (*) as you type your password.

If you don’t see pam_unix.so explicitly, add this line above any auth line that includes system-auth or common-auth:

text
auth    sufficient pam_unix.so echo=*

3. Save and test

  • Save the file (Ctrl+O, then Ctrl+X in nano).
  • Test by running:
    bash
    sudo -v
    You should now see * appear as you type your password.

⚠️ Notes

  • This change only affects sudo, not the login screen or other password prompts.
  • If you're using pkexec (e.g., GNOME's graphical sudo), this won’t apply. For that, you’d need to modify /etc/pam.d/polkit-1, but pkexec doesn’t support echoing by default.
  • This works on Debian 13 (Trixie) and most Linux distributions using PAM.

Sep 19, 7:06pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more