· 7 years ago · Apr 09, 2018, 01:58 AM
1# Get the IP of the remote ssh client (64.233.160.1).
2txor@lulz# netstat -putan | grep SHE | grep ssh
3tcp 0 0 192.168.1.1:22 64.233.160.1:55783 ESTABLISHED 15908/sshd: txor [p
4
5# Get the DISPLAY value of that IP.
6txor@lulz# ps aeo pid,command | grep SSH_CLIENT=192.168.1.12 | grep -v grep | sed -e 's:.* DISPLAY=\([^ ]*\) .*:\1:'
7localhost:10.0
8
9# Send the message!
10DISPLAY=localhost:10.0 xmessage "I Can Has Cheezburger?"