Access Remote Clipboard Content
On Linux
Send to Linux
xsel -b | ssh linux2 "DISPLAY=:0 xsel -i -b"
Receive from Linux
ssh linux2 "DISPLAY=:0 xsel -b" | xsel -i -b
Send to macOS
xsel -o | ssh macos pbcopy
Receive from macOS
echo -n "$(ssh macos pbpaste)" | xsel -i
On macOS
Send to Linux
pbpaste | ssh linux 'DISPLAY=:0 xsel -i'
Receive from Linux
echo -n "$(ssh linux 'DISPLAY=:0 xsel -o')" | pbcopy