I’ve recently had a case where I needed to talk with another user that was connected to the Droplet with SSH which prompted me to write this quick mini-tutorial.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
To communicate with another user who is connected to the same server via SSH, you can use several command-line utilities available on most Unix-like systems. The most commonly used commands for sending messages to other users on the same server are
write
,wall
, andtalk
. Here’s how to use each of them:1. Using the
write
CommandThe
write
command sends a message to another user who is logged in by specifying their username and the terminal name (if they are logged in multiple terminals). You can see the terminals with thewho
command.This command shows a list of all logged-in users, their terminals, and other login info.
Send a message:
username
with the user’s username andtty
with their terminal name from thewho
output. After executing the command, you can start typing your message. Finish by pressingCTRL+D
to end the message.2. Using the
wall
CommandThe
wall
(write all) command sends a message to all logged-in users. This is particularly useful for sending system-wide notifications.wall
followed by your message enclosed in quotes. You might need superuser privileges depending on your system’s configuration.3. Using the
talk
CommandThe
talk
command allows a two-way interactive communication between two users.Initiate a talk session:
username
with the user’s username. Thetty
is optional if the user is logged in at more than one terminal. The user on the other end will see a message asking if they accept the talk request.4. Using
mesg
CommandBefore using
write
ortalk
, it’s good practice to check if the user has allowed messaging through themesg
command. Users can control whether they receive messages from other users with this command.5. Examples:
Here is a practical example of how to use these commands:
write
:wall
:Remember that for
write
andtalk
, the user must have their message setting enabled (mesg y
). These methods are straightforward for quick and direct text-based communication on servers where multiple users are logged in via SSH.