On Debian (and most Linux systems), the wall command sends a message to all logged-in users. However, by default, it does not display messages on the login prompts (like the tty1 console or getty sessions) because those are not considered "logged-in" sessions.
To ensure your wall message also appears on the login prompts (e.g., Debian GNU/Linux 13 debian tty1 and the login:/password: prompts), you need to configure the system to allow messages to be sent to all terminals, including those managed by getty or agetty.
mesg and wall with tty BroadcastEnable messages on all TTYs:
By default, some TTYs (like /dev/tty1) may have message reception disabled. You can enable it with:
bashsudo mesg y /dev/tty*
This allows all TTYs to receive broadcast messages.
Send the message with wall:
Use the wall command as usual:
bashecho "Your message here" | wall
This will now also appear on the login prompts if mesg is enabled.
pam_wall (PAM Module)If you want login prompts to always show system messages (e.g., for maintenance notifications), you can configure PAM (Pluggable Authentication Modules) to display a custom message before login.
Edit the PAM configuration:
Open /etc/pam.d/login and add:
textsession optional pam_wall.so
This will display the contents of /etc/issue (or a custom file) before the login prompt.
Edit /etc/issue:
Add your message to /etc/issue (e.g., echo "System maintenance at 2 AM" | sudo tee /etc/issue).
Restart getty:
Restart the console service (e.g., systemctl restart getty@tty1).
If you want to send a message immediately to all TTYs (including login prompts), you can write directly to each TTY device:
bashecho "Your message here" | sudo tee /dev/tty*
This forces the message to appear on all active TTYs, including login prompts.
mesg y /dev/tty* + wall.pam_wall + /etc/issue.tee /dev/tty*.Vibe can make mistakes. Check answers. Learn more