Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am connecting to remote Linux PCs via ssh, to update software and do other tasks. I want to send a notification to the remote PCs screen (eg, "Do not run program X, it is being updated now"), so the users do know what is happening.

Is there a reverse way for ssh -X host so I can connect to a remote Linux machine and run notify-send and it appears on the other display?

share|improve this question
    
notify-send is just an example, right? Assuming "PC" refers to Windows, I guess notify-send won't work on the target machine. Or am I not understanding the question? –  Arjan Jan 20 '11 at 10:31
    
@Arjan, nope - all remote PCs are running linux, so I will be using notify-send :-) –  skazhy Jan 20 '11 at 11:18
add comment

3 Answers 3

If Windows, you can take a look at the net msg (sp?) command from the command line. Try net msg help.

If Unix, there is the wall command, which writes to everybody's terminal (must be run as root). There is no way to connect to people's X11 server.

share|improve this answer
add comment

Do

man xhost

Below is a simple example that shows how to run X application remotely.


Add

xhost +local:

in ~/.xinitrc of the remote mahcine, then restart X by

sudo systemctl restart xdm.service

Then ssh into the remote machine, try execute xclock.

share|improve this answer
add comment

try: ssh user@hostname:~ "DISPLAY=:0 notify-send 'subject' 'message'"

DISPLAY=:0 assumes single user, single X-session etc. If it's more involved than this, than the best thing to do is have a notification script that gets executed, instead of notify-send directly, which could go through the hoops of parsing output from 'who' to find out which terminal and X display best suits your purposes.

share|improve this answer
add comment

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.