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?

  • 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


man xhost

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


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.


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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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