How do I echo a message to a terminal on another IP address
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I echo a message to a terminal on another IP address
Hi. Im using SUSE. I've recently learned how to send messages between terminals with echo and tty. This is what I know (please correct if I'm wrong...im a real newbie on linux):
I open the second terminal (the one I want to send the message to) and use tty to gets its name
I go back to my first terminal (the one Im sending the message from) and type this:
echo "message" > address_given_by_tty
It works great, mostly because its in the same machine. What I want to know is how do I echo a message to a remote terminal on another machine (I know its reduntant the "remote", but anyhow) in the same LAN. More specifically, how do I echo a message to a terminal in another machine by its IP address. Thanks.
You can use the write command to send messages locally which is probably betther than using your method (read "man write" for more details). Unfortunately AFAIK it only works locally. To send messages to a remote host you could try talk or rwall. These utilities may not be installed on you system but there should be packages available.
Instead of doing the echo and re-directing to the other user's tty, you can use the write command. See the write manpage for more info. A user can specify if they want to receive messages in a given tty using the mesg command. "mesg n" turns off messages, "mesg y" turns them on.
Between machines is a different matter. Assuming you have an account on it, you could log into the remote machine with ssh and use write in the ssh session.
If that's not good for you for some reason, the best thing to do is use an IM setup. Jabber is an open protocol and you can get free clients and servers.
Assuming you can ssh to the machine, and allow X forwarding with your sshd config, and have ssh set the Xauthority file, you could also ssh and execute xmessage, or kdialog or something. That's bound to really annoy the users
For all of these ssh-based alert, you've got a scalability problem. ssh handshakes make quite a lot of load on both parties, so if you're sending to a large number of machines fro one machine, the sender will get hammered quite heavily.
UNIX and LINUX has a command utility for "talking" between terminals, sort of like a text-based chat.
The server service (in case it's not installed on your system) is "talkd"
and the client service is "talk". Install them both, on both systems.
You might also want to install "fingerd" and "finger" ...
These give you a quick reference to identify a user, their contact info and the terminal(s) they are currently logged on to.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.