If you've ever run ssh -Y $someoneElse@localhost, you probably noticed that the program you're operating runs quite sluggishly (at least compared to how it's "asposta" run or does when run normally).

You may have independently discovered this "cheesy" workaround (just a cleaner alternative to copying ~/.Xauthority):

ssh -t $someoneElse@localhost "xauth add $(xauth list); DISPLAY=$DISPLAY $0"

But here's a far cleaner option:

xhost +si:localuser:$someoneElse
ssh -o SendEnv=DISPLAY $someoneElse@localhost

Note you may have to reconfigure your server to allow this:

grep '^AcceptEnv.*DISPLAY' /etc/sshd\
|| ( sudo sed -e 's/^\(AcceptEnv\) /\1 DISPLAY ' -i /etc/ssh/sshd_config\
     && sudo service sshd restart

While you're at it, here's how you allow those programs to play audio (if your system has a PulseAudio setup like most these days):

pax11publish -S /run/user/$UID/pulse/native -e
setfacl -m u:$someoneElse:x /run/user/$UID /run/user/$UID/pulse
setfacl -m u:$someoneElse:rw /run/user/$UID/pulse/native
setfacl -m m::rwx /run/user/$UID/pulse

Leave a Reply

Your email address will not be published.

Warning: This site uses Akismet to filter spam. Until or unless I can find a suitable replacement anti-spam solution, this means that (per their indemnification document) all commenters' IP addresses will be sent to Automattic, Inc., who may choose to share such with 3rd parties.
If this is unacceptable to you, I highly recommend using an anonymous proxy or public Wi-Fi connection when commenting.