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"