Loading...

Lab 30: Communicating with Users

Notify active users about an upcoming maintenance window using the built-in terminal messaging tools. Identify active sessions, broadcast a message to all users, and send a targeted message to a specific TTY.

users core boot

Scenario

A scheduled maintenance window is about to begin. You need to alert everyone currently logged into the host, then notify a specific user that they still have an open session and should log off before the work begins.

Operator context

This is the kind of quick comms you do right before a reboot, patch cycle, storage maintenance, or network change.

Objective

  • List who is logged in (and capture TTYs).
  • Broadcast a one-line message to all users.
  • Send a targeted message to a specific user session.

What You’ll Practice

  • Session visibility with who and basic listing with users.
  • System-wide broadcast messaging with wall.
  • Direct user messaging to a specific terminal with write.
  • Understanding when you need a TTY (for targeted messaging).

Walkthrough

Step 1 : View currently logged-in users and their TTYs.
Command
who

who is the preferred tool when you need to target a specific session because it includes the TTY (for example, pts/2).

devstudent pts/0  2025-07-19 08:31 (:0)
sysmon     pts/1  2025-07-19 08:33 (10.0.0.15)
analyst    pts/2  2025-07-19 08:34 (10.0.0.42)
Alternate
users

users is a quick glance at who is logged in, but it does not show TTYs, so it is weaker for targeted messaging.

devstudent sysmon analyst
Step 2 : Broadcast a system-wide maintenance message.
Command
wall "System maintenance starts in 10 minutes. Please save your work."

wall writes to all logged-in terminals. Keep it short, actionable, and time-bound.

Broadcast message from root@server01 (tty1) (Fri Jul 19 08:35:12):
System maintenance starts in 10 minutes. Please save your work.
Step 3 : Send a private message to a specific TTY using write.
Command
write analyst pts/2

write targets one session, so the TTY must match what you discovered in Step 1. After starting the write session, type your message and press Ctrl+D to send.

[write session open - type your message and press Ctrl+D to send]
Hi analyst, please log off before 08:45 for scheduled maintenance.
[Message sent]

Reference

  • who : Shows logged-in users with TTY and source address (best for targeted messages).
  • users : Quick list of usernames currently logged in (no TTY info).
  • wall <message> : Broadcasts a message to all logged-in terminals.
  • write <user> <tty> : Sends a message to a specific user session; finish input with Ctrl+D.