<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nils Jonas Fink on Medium]]></title>
        <description><![CDATA[Stories by Nils Jonas Fink on Medium]]></description>
        <link>https://medium.com/@link2fink?source=rss-2d04b618b48b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Nils Jonas Fink on Medium</title>
            <link>https://medium.com/@link2fink?source=rss-2d04b618b48b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:39:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@link2fink/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Apple Magic Keyboard on Linux: pairs, connects, doesn’t type. Here’s the fix.]]></title>
            <link>https://medium.com/@link2fink/apple-magic-keyboard-on-linux-pairs-connects-doesnt-type-here-s-the-fix-0a5d5323fa3e?source=rss-2d04b618b48b------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a5d5323fa3e</guid>
            <category><![CDATA[magic-keyboard]]></category>
            <category><![CDATA[hardware]]></category>
            <category><![CDATA[linux-tutorial]]></category>
            <category><![CDATA[bluetooth]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Nils Jonas Fink]]></dc:creator>
            <pubDate>Wed, 08 Jul 2026 14:15:50 GMT</pubDate>
            <atom:updated>2026-07-08T14:15:50.667Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9cpvk8f3NZZTmpDPMnjToA.png" /></figure><p>My Magic Keyboard (A2450) worked with my Linux desktop for over a year. Then I paired it to a MacBook for a week, brought it back, and lost an afternoon to it. It showed up in Bluetooth settings but wouldn’t connect. Then it paired but dropped after seconds. Then it connected — GNOME said so! — and produced zero keystrokes.</p><p>This is the guide I wish I’d found: the debugging session compressed into the right steps, with the real commands and error messages.</p><p><strong>The two traps:</strong></p><ol><li>A Magic Keyboard that was paired to a Mac <strong>hides from everyone else</strong>. It only broadcasts anonymous beacons under rotating random addresses. “Disconnect” on macOS doesn’t release it — the bond has to be destroyed properly.</li><li>bluetoothctl pair without a pairing agent creates an <strong>unauthenticated pairing with no bond</strong>. The keyboard tolerates it for about three seconds, then hangs up and revokes it. Paired: yes next to Bonded: no in bluetoothctl info is the tell.</li></ol><p>Setup: Arch-based distro (CachyOS), BlueZ 5.86, GNOME. Should transfer to anything with recent BlueZ.</p><h3>Step 0 — Plug it in</h3><p>The keyboard works perfectly over USB the whole time, so a Lightning cable gives you a working keyboard for the rest of this guide. You’ll unplug it only for the actual pairing moment — while wired, it doesn’t advertise properly over Bluetooth.</p><p>If typing over the cable doesn’t work, check that the cable carries data (charge-only Lightning cables are everywhere):</p><pre>$ lsusb | grep -i apple<br>Bus 005 Device 019: ID 05ac:029c Apple, Inc. Magic Keyboard</pre><h3>Step 1 — Release the keyboard from the Mac</h3><p>Do this exactly in this order:</p><ol><li>Let the keyboard <strong>connect to the Mac</strong> (turn the Mac’s Bluetooth on if needed — it’ll connect instantly, that’s the whole problem).</li><li>System Settings → Bluetooth → Magic Keyboard → ⓘ → <strong>Forget This Device</strong>.</li><li>Turn the Mac’s Bluetooth <strong>off</strong>.</li></ol><p>The order matters: forgetting the keyboard while it’s <em>not</em> connected only cleans up the Mac’s side, and the keyboard keeps its bond and keeps hiding. The unpair command has to reach the keyboard over an active connection.</p><p>How to recognize this trap in bluetoothctl with scan on: a nameless device with a very strong signal (it&#39;s on your desk) that keeps <em>changing its MAC address</em>:</p><pre>[NEW] Device 5C:30:82:50:20:85 5C-30-82-50-20-85<br>...<br>[NEW] Device 5D:B7:24:BB:39:B4 5D-B7-24-BB-39-B4    ← same device, new address</pre><p>info on it shows Apple manufacturer data, a (random) address type, and no keyboard class:</p><pre>Device 5D:B7:24:BB:39:B4 (random)<br>        ManufacturerData.Key: 0x004c (76)</pre><p>Those are the keyboard’s “I belong to a Mac” beacons. Pairing attempts against them fail with org.bluez.Error.AuthenticationFailed. A keyboard that&#39;s actually ready to pair shows up with a stable (public) address.</p><h3>Step 2 — Remove the stale pairing</h3><pre>$ bluetoothctl remove 88:4D:7C:E7:91:45<br>Device has been removed</pre><p>Colons in the MAC, not dashes — bluetoothctl won&#39;t recognize 88-4D-7C-E7-91-45. If you don&#39;t know the address, bluetoothctl devices lists what BlueZ has stored; the keyboard is usually still in there from better days.</p><h3>Step 3 — Pair with an agent (the step everyone gets wrong)</h3><p>Don’t just run pair — register an agent first, inside an interactive bluetoothctl session:</p><pre>$ bluetoothctl<br>[bluetoothctl]&gt; agent KeyboardDisplay<br>Agent registered<br>[bluetoothctl]&gt; default-agent<br>Default agent request successful<br>[bluetoothctl]&gt; scan on</pre><p>Now the physical ritual: <strong>unplug the cable, switch the keyboard off, wait five seconds, switch it on.</strong> Freshly orphaned and power-cycled, it advertises under its real (public) address:</p><pre>[NEW] Device 88:4D:7C:E7:91:45 88-4D-7C-E7-91-45</pre><p>Pair it quickly — the pairable window is short:</p><pre>[bluetoothctl]&gt; pair 88:4D:7C:E7:91:45<br>Attempting to pair with 88:4D:7C:E7:91:45<br>Request confirmation<br>[agent] Confirm passkey 652146 (yes/no): yes<br>[CHG] Device 88:4D:7C:E7:91:45 Bonded: yes<br>Pairing successful</pre><p>The Confirm passkey prompt is why the agent matters. Answering it upgrades the pairing to an <em>authenticated bond</em> — the Bonded: yes line. Without an agent, BlueZ falls back to unauthenticated &quot;Just Works&quot; pairing, and the keyboard, which requires authentication before acting as an input device, drops the link seconds later and takes the pairing with it:</p><pre>[SIGNAL] BREDR.Disconnected - org.bluez.Reason.Remote, Connection terminated by remote user<br>[CHG] Device 88:4D:7C:E7:91:45 Paired: no</pre><p>Reason.Remote disconnects and evaporating pairings mean the keyboard is hanging up on you: back to the top of this step.</p><p>Two practical notes:</p><ul><li><strong>No working keyboard to type </strong><strong>pair and </strong><strong>yes with?</strong> Pre-type the commands in a text editor before unplugging, then select each line — including its trailing newline — and middle-click-paste it into the terminal; the paste executes in one click. Or borrow any USB keyboard for five minutes.</li><li>Instead of a yes/no confirmation, you may get a <strong>passkey to enter</strong>. Type it <em>on the Magic Keyboard</em> and press Enter — on the Magic Keyboard. This works even though it isn’t connected yet; passkey entry is part of the pairing protocol itself.</li></ul><h3>Step 4 — Trust, connect, verify</h3><pre>[bluetoothctl]&gt; trust 88:4D:7C:E7:91:45<br>[bluetoothctl]&gt; connect 88:4D:7C:E7:91:45<br>Connection successful<br>[bluetoothctl]&gt; info 88:4D:7C:E7:91:45</pre><p>trust restores automatic reconnect after power cycles. In the info output, one line decides everything:</p><pre>Paired: yes<br>        Bonded: yes      ← this one<br>        Trusted: yes<br>        Connected: yes</pre><p><em>Paired</em> and <em>bonded</em> are not synonyms — pairing establishes an encrypted session, bonding stores authenticated long-term keys, and the Magic Keyboard insists on the latter. Every failed state I hit had Bonded: no in it, and I looked straight past it for hours.</p><p>Then type something. My confirmation was a proud aaaaaaaaaaaa landing in the terminal mid-command, over the air. Flip the switch off/on once as a final test — it should reconnect by itself within seconds.</p><h3>Closing remark</h3><p>Nothing here was broken. Apple’s address randomization and the keyboard’s authentication requirement are security mechanisms doing their jobs — and their combined effect is a keyboard that pairs, reports as connected, and types nothing, while every status readout tells you something technically true and practically useless. Debug from journalctl -u bluetooth -f and bluetoothctl info, not from the GUI; GNOME&#39;s panel hides nameless devices and cheerfully reports &quot;connected&quot; for links that carry no input.</p><p>I’m fairly sure I solved a version of this a year ago and left no notes. This post is the notes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a5d5323fa3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>