LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I echo a message to a terminal on another IP address (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-echo-a-message-to-a-terminal-on-another-ip-address-508046/)

fdvj 12-06-2006 08:31 PM

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.

btmiller 12-06-2006 08:45 PM

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.

matthewg42 12-06-2006 09:05 PM

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.

vimalkumar_k 12-07-2006 06:41 AM

Hi...
we usually annoy other users in the network in a different way:

ssh to their machine ... n then
echo "message to be displayed" >> /dev/console

OR

set a crontab there ...

OR

init 0 (shutdown their computer)

matthewg42 12-07-2006 09:48 AM

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 :D

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.

rAllcorn@quest.uucpnet.n 05-13-2013 08:04 AM

Have you tried the TALK command?
 
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.

Hope this help!


All times are GMT -5. The time now is 07:51 PM.