Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to find a way to send a message (like a popup message) from 1 PC to another. both are using Ubuntu. Already tried the smbclient way but this only works between a linux PC to a windows PC. I need a way to send messages from an Ubuntu PC to another Ubuntu PC. Similar to the way of Windows Net Send.

share|improve this question
    
notify-send sends a pop up on my terminal but I wanted to send a popup to other users (may be a list of specific users) but without using sudo or ssh , do I have any alternative .A command which works as "notify-send" but to send message on other user terminal. – srisha Feb 24 at 11:09
up vote 22 down vote accepted

Install SSH, and libnotify-bin (via terminal)

sudo apt-get install ssh libnotify-bin

on both computers.

(you may have libnotify-bin installed already. Mine had it already.)

Then SSH (via the terminal) into the other computer

ssh <user name>@<ip address>

and then when you're logged in, type:

export DISPLAY=:0
notify-send "Title of message" "message text"

Happy message-sending! (or scaring XD)

share|improve this answer
    
Even though this is a very intelligent answer am trying to find a way to send it without ssh. With the ssh option i already know it works (using wall for example) but your notify-send is very smart. – Luis Alvarado Mar 23 '11 at 1:34
1  
After searching several methods this one is the best. Because of 2 reasons: 1. ssh gives me some security over doing this and 2. The use of DISPLAY allows to select to which video the message will show. I tested using ssh user@ip/domain 'DISPLAY=:0 notify-send "TITLE" "MESSAGE"' – Luis Alvarado Apr 5 '11 at 17:00
    
It may work in a home enviorment, but in a large organisation, i am not sure if it is possible to install SSH on every client system, I have experience as in my office there are about 100 coms, there should be another way to send a message with out installing SSh – The_skinny_man Oct 26 '11 at 5:25
    
Check out my answer for accomplishing this without ssh! :) – Matt Oct 26 '11 at 6:05

I read you wanted to do this without SSH, I believe I have a solution: netcat [nc] It comes with Ubuntu by default.

First we need a "daemon" to run in the background. Second, we need a program to make the alert pop up. I have zenity installed. If you do not, please install it, or edit the script to use whatever you like [e.x. xmessage, but that is ugly]. Next, paste this into 'daemon.sh':

#!/bin/bash
port=3333
nc -l $port | while read msg; do zenity --info --text "$msg"; done

Now, make it executable chmod +x daemon.sh, now run it in the background: ./daemon.sh &

Now you're done! Well, you actually need to do this on each computer. You also will want to automate the start of the daemon. Open the 'startup' applications from the menu, and add your script. Once that's done, to send a message to the other computer, type in:

nc 192.168.1.X 3333 then type your message and hit Enter. Each enter line will make a message pop up. To exit nc, press Ctrl +C, or Ctrl +D.

Just make sure to replace 192.168.1.X with the real local IP of the other PC. [You can use ifconfig to find the IP address]

I see you already have accepted an answer for this question :( But if my solution works for you, please at least give me a Upvote! Thanks. Also, you could also make another script, say, message.sh. In that, paste:

#!/bin/bash
nc 192.168.2.X 3333

Then chmod +x message.sh. Then you can just type ./message.sh then type your message, then enter, and your message is sent. Also, now that I think of it, you could also add a sound notification. I would recommend mplayer, it's a CLI media player. Shouldn't be too hard to figure out, but if you have any questions, please don't hesitate to ask!

share|improve this answer
2  
I would actually give you 100 upvotes if I could. It is a very smart and easy way of doing it. +1 to you. – Luis Alvarado Oct 26 '11 at 6:06
    
^_^ Thanks. I didn't expect you to "Accept" my answer, but I like answering these kind of questions [where I can use what I've learned the last few years on linux to help other people] so I answered it anyway. – Matt Oct 26 '11 at 6:09
    
This is a neat solution, but I kinda prefer SSH because of security purposes. – Jonathan Nov 23 '11 at 2:08
1  
Someone told me you can use socat instead of netcat, for SSL encryption. I never looked into it though. – Matt Nov 24 '11 at 0:06
3  
Wow! nicely done! I changed it a bit to work with notify-osd: nc -l $port | while read msg; do notify-send "$HOSTNAME" "$msg" -i gtk-network; done – Khurshid Alam Jun 4 '13 at 14:50

If you want something simple that does not involve creating script files or using code here is a VERY easy to use, multi platform called PUSHBULLET

enter image description here

You can send files and text to your mobile devices and your different computers. Multi platform and very easy to use & install. This also includes encryption.

I use this on my Ubuntu machine to push links to my other Ubuntu, OSX and Iphone.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.