Mac to Linux Clipboard Solutions: How to Share Copy and Paste Between Both
There is no built-in way to share a clipboard between a Mac and a Linux machine, because Apple’s Universal Clipboard only works between Apple devices. The practical options are a shared keyboard-and-mouse tool (Deskflow, Input Leap), a dedicated clipboard sync app such as ClipCascade, terminal-level tricks like OSC 52 or ssh with pbcopy and xclip, or a remote desktop session that forwards the clipboard. Which one fits depends on whether the two machines sit on your desk, on your network, or across the internet.
Quick answer
- Two computers on one desk: Deskflow or Input Leap (one keyboard and mouse, shared clipboard).
- Two computers, different rooms or networks: a self-hosted clipboard sync app such as ClipCascade.
- Linux is a server or you live in the terminal: OSC 52 escape sequences, or pipe through
ssh. - You already use remote desktop: enable clipboard redirection in RDP or VNC.
- Need clipboard history, not just sync: run a clipboard manager on each side (Maccy on the Mac, CopyQ on Linux).
Why doesn’t Universal Clipboard work with Linux?
Universal Clipboard is part of Apple’s Continuity features. It relies on iCloud sign-in, Bluetooth LE for proximity, and Wi-Fi for the transfer, all tied to Apple devices. Nothing in that stack is exposed for third-party operating systems. So any Mac-to-Linux solution has to move clipboard contents over a channel you control: your LAN, an SSH connection, a remote display protocol, or a small sync server.
Two further details make this harder than it looks:
- The clipboard isn’t one thing on Linux. X11 has separate PRIMARY (select to copy, middle-click to paste) and CLIPBOARD (Ctrl+C / Ctrl+V) selections. macOS has only one general pasteboard. Sync tools generally map macOS’s pasteboard to the Linux CLIPBOARD selection, and PRIMARY stays local.
- Wayland restricts background clipboard access. Under Wayland, a program usually can’t read the clipboard unless it has focus or uses a compositor-specific protocol. That is why some sync tools behave perfectly on X11 and unreliably on a Wayland session. Check your desktop environment’s compatibility notes before committing to a tool.
Which solution fits your setup?
| Your situation | Best fit | Needs a server? | Handles images/files? | Main catch |
|---|---|---|---|---|
| Mac and Linux PC side by side | Deskflow / Input Leap | No (one machine acts as server) | Text for sure; other formats vary | Same network required; Wayland support varies |
| Machines on different networks | ClipCascade (self-hosted) | Yes, one you run yourself | Text; check current release for more | You maintain the server |
| Linux server over SSH | OSC 52 or ssh + pbcopy/xclip |
No | Text only | Terminal support differs; size limits |
| Linux desktop you remote into | RDP / VNC clipboard redirection | No | Usually text, sometimes more | Only works during the session |
| Occasional one-off transfers | Manual: file, note, or scp |
No | Anything | Not automatic |
Option 1: Share one keyboard, mouse and clipboard (Deskflow or Input Leap)
If both computers are physically near each other, this is the lowest-friction route. Deskflow, the privacy-security/is-maccy-safe-privacy-security-review-2026″>open-source project that Synergy’s core grew from, and Input Leap, a community fork of Barrier, let you move your cursor off one screen onto the other. The clipboard travels with you: copy on the Mac, move the cursor to the Linux screen, paste.
How it works in practice
- Pick one machine as the server (the one whose keyboard and mouse you will use) and the other as the client.
- Install the app on both, and arrange the screen layout (for example, Linux to the left of the Mac).
- On the Mac, grant the app permission under System Settings → Privacy & Security → Accessibility. Without it, input forwarding fails silently. Input capture may also need Input Monitoring.
- Connect the client to the server’s address and confirm the fingerprint or certificate prompt if shown.
Honest trade-offs
- You get keyboard and mouse sharing whether you want it or not. If you only want the clipboard, it’s more than you need.
- Wayland on the Linux side is the usual pain point, since synthetic input and clipboard access are restricted by design. Check the project’s current Wayland status before you start.
- Barrier itself is no longer actively maintained as far as I know, which is why people moved to Input Leap or Deskflow.
Option 2: A dedicated clipboard sync app (ClipCascade and similar)
If you want the clipboard to follow you across machines without sharing input, look at tools built only for that. ClipCascade is an open-source, self-hostable clipboard sync project with clients for several platforms including macOS and Linux. The model: a small server you run (a home server or cheap VPS), and a client on each device that pushes and pulls clipboard changes.
Why choose this route: it works across networks, and you control where your clipboard data goes. That matters because clipboards routinely contain passwords, tokens, and private messages.
What to check before trusting it:
- Is traffic encrypted end to end, or only in transit to your server?
- Can you exclude sensitive sources? (On the Mac, Maccy has an ignore list under Settings → Ignore, and macOS password managers typically mark their entries as concealed so well-behaved clipboard tools skip them.)
- How does it behave on Wayland? Same caveat as above.
Avoid closed-source sync tools that route clipboard text through a vendor’s cloud unless you’ve read their privacy model. A clipboard sync service sees everything you copy.
Option 3: Terminal-first workflows
If the Linux machine is a server, a VM, or a box you only touch through a terminal, skip GUI syncing entirely.
Method A: pipe through SSH
From the Mac, send the Mac clipboard to a file or command on the Linux host:
pbpaste | ssh user@linuxhost 'cat > ~/clip.txt'
Pull text from the Linux host into the Mac clipboard:
ssh user@linuxhost 'cat ~/notes.txt' | pbcopy
On a Linux desktop with a graphical session, you can target its clipboard directly, but the SSH session needs access to the display. On X11:
pbpaste | ssh user@linuxhost 'DISPLAY=:0 xclip -selection clipboard'
On Wayland, use wl-copy from the wl-clipboard package, and be prepared to set WAYLAND_DISPLAY and XDG_RUNTIME_DIR for the SSH session, since they aren’t set by default. This often takes some trial and error.
Method B: OSC 52 (copy from a remote shell to your Mac clipboard)
OSC 52 is a terminal escape sequence that asks your local terminal emulator to set its clipboard. Because it travels through the terminal stream, it works across SSH and through tmux with no extra network plumbing. A minimal example from the Linux side:
printf '\033]52;c;%s\a' "$(printf 'hello from linux' | base64)"
Things to know:
- The terminal must support it and allow it. In iTerm2 this is a setting, found under Settings → General → Selection as “Applications in terminal may access clipboard”. Kitty, WezTerm, and Alacritty also support OSC 52 in various forms, but defaults differ.
- Apple’s Terminal.app historically does not support OSC 52.
- Inside tmux, you need
set -g set-clipboard on(orexternal) and sometimes passthrough configuration. - Terminals commonly cap the payload size, so it suits snippets and not large blobs.
- Reading the Mac clipboard from the remote side over OSC 52 is usually disabled for security reasons. Treat it as a one-way copy-out tool.
Option 4: Remote desktop clipboard redirection
If you already connect from your Mac to a Linux desktop with RDP (for example via xrdp) or VNC, the clipboard often syncs for free during the session. Microsoft’s Windows App on the Mac, and most VNC clients, offer a clipboard redirection toggle. It’s simple and requires no extra software, but it only works while the session is open, and plain text is far more reliable than rich content. Wayland-based Linux desktops can again complicate things, depending on the remote display server involved.
What if you want history, not just sync?
Syncing and history are different problems. Sync answers “can I paste on the other machine?” History answers “what was that thing I copied twenty minutes ago?” Most sync tools only guarantee the latest item.
A pragmatic pairing that keeps everything local:
- On the Mac: Maccy keeps a searchable history of what you copy and stays fully local, with no account and no cloud. Open it with its hotkey, type to filter, press Enter to paste. Maccy does not sync with other computers itself, so pair it with one of the transport options above.
- On Linux: CopyQ is a cross-platform clipboard manager with history, tabs, and scripting.
The sync tool moves the newest item across, and each machine’s own manager keeps its history. That separation also limits the blast radius: if you exclude a sensitive source on one side, it won’t be shipped across the network.
Common problems and how to fix them
| Symptom | Likely cause | What to try |
|---|---|---|
| Copy on Mac works, paste on Linux gives old content | X11 PRIMARY vs CLIPBOARD mismatch | Paste with Ctrl+V (CLIPBOARD), not middle-click (PRIMARY) |
| Works on X11, flaky on Wayland | Wayland blocks background clipboard reads | Check for a Wayland-aware client; try an X11 session to confirm |
| Mouse/keyboard sharing silently dead on Mac | Missing Accessibility permission | System Settings → Privacy & Security → Accessibility |
| OSC 52 does nothing | Terminal setting off, or tmux not forwarding | Enable clipboard access in the terminal; set tmux set-clipboard |
| Accented or emoji text corrupts | Locale or encoding mismatch over SSH | Make sure both sides use UTF-8 (LANG=en_US.UTF-8 or similar) |
| Images or files don’t transfer | Tool is text-only | Use scp, Syncthing, or LocalSend for files |
A note on privacy
Whatever you choose, remember that a synced clipboard is a stream of everything you copy, including passwords, 2FA codes, and private messages. Prefer tools you can self-host or inspect, keep traffic on your LAN or a VPN such as WireGuard or Tailscale where possible, and set up exclusions for password managers. For genuinely sensitive items, don’t sync at all. Paste them manually.
Frequently asked questions
Can I use Apple’s Universal Clipboard with Linux?
No. Universal Clipboard only works between Apple devices signed in to the same Apple Account. For Linux you need a third-party tool or a protocol-level method like SSH, OSC 52, or remote desktop redirection.
What’s the easiest way to copy text from a Linux server to my Mac clipboard?
OSC 52, if your terminal supports it. It sends the text through your existing SSH terminal session to the local clipboard with no extra software. Otherwise, pipe the output over SSH into pbcopy on the Mac.
Does Maccy sync across devices or to Linux?
No. Maccy is a local-first macOS clipboard manager and doesn’t sync history to other devices. You can combine it with a sync tool or the SSH techniques above to move individual items between machines.
Is Deskflow the same as Synergy or Barrier?
They are related. Synergy is the original commercial project, Barrier is an open-source fork of it, and Input Leap is a fork of Barrier. Deskflow is the upstream open-source project associated with Synergy’s core.
Why does clipboard sync work on X11 but not Wayland?
Wayland limits which applications can read or set the clipboard in the background, for security. Tools designed around X11’s open clipboard model may need Wayland-specific support to work reliably.
The bottom line
Match the method to the distance. Same desk: a shared input tool. Different networks: a self-hosted sync app. A Linux box you reach over SSH: OSC 52 and pipes. A remote desktop session: built-in redirection. Whatever transport you choose, keep a local history manager on each machine, so a missed paste never costs you the thing you copied.
Which side of this setup gives you the most trouble: Wayland quirks, terminal support, or something else?