[arch-general] Copy remote command server to clipboard

ProgAndy admin at progandy.de
Mon Aug 26 12:30:15 UTC 2019


Am 26.08.19 um 13:47 schrieb Maykel Franco via arch-general:
...
> Many thanks Ralph, it works, but... Is possible launch the command in my server?
> 
...

Hello Maykel,

You can run a local server that copies everything it receives to the
clipboard. Then set up ssh remote port forwarding and send clipboard
data to this port.

You need either netcat (nc) or socat as well as xsel, xclip or wl-clipboard.

Server:
$ socat TCP-LISTEN:6789,reuseaddr,fork EXEC:"/usr/bin/xsel -ib"

SSH:
$ ssh user at example.com -R 6789:localhost:6789
Or set RemoteForward in your config.

copy on server:
$ uname -a | nc -c localhost 6789
or
$ uname -a | socat -u - TCP:localhost:6789

https://gist.github.com/dergachev/8259104

--
Andy


More information about the arch-general mailing list