Skip to content

Instantly share code, notes, and snippets.

View GiuseppeMP's full-sized avatar
:copilot:
Making sure gas and oil don’t get lost on the way 🦖🦖

Giuseppe Matheus (Beppe) GiuseppeMP

:copilot:
Making sure gas and oil don’t get lost on the way 🦖🦖
View GitHub Profile
@GiuseppeMP
GiuseppeMP / ssh-forward-clipboard.md
Created March 12, 2024 00:00 — forked from dergachev/ssh-forward-clipboard.md
Forward your clipboard via SSH reverse tunnels

Exposing your clipboard over SSH

I frequently administer remote servers over SSH, and need to copy data to my clipboard. If the text I want to copy all fits on one screen, then I simply select it with my mouse and press CMD-C, which asks relies on m y terminal emulator (xterm2) to throw it to the clipboard.

This isn't practical for larger texts, like when I want to copy the whole contents of a file.

If I had been editing large-file.txt locally, I could easily copy its contents by using the pbcopy command: