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:#1000"
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/$(id -u)/pulse/native" -e
setfacl -m u:someoneELse:x "/run/user/$(id -u)" "/run/user/$(id -u)/pulse"
setfacl -m u:someoneElse:rw "/run/user/$(id -u)/pulse/native"
setfacl -m m::rwx "/run/user/$(id -u)/pulse"

Leave a Reply

Your email address will not be published. Required fields are marked *

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.