MyRaspberryAndMe

Tinkering with Raspberry (and other things)

Mac OS – El Capitan bluetooth discoverabilty

I recently upgraded my Mid 2011 Mac Mini to El Capitan and had to discover that when Bluetooth was switched on, the machine stayed discoverable via Bluetooth. Living in the middle of a big city this is a gerat security risk. I just don’t want everybody in the neighborhood to be able to see my Mac.

There are numerous instructions on the internet on how to disable the bluetooth visiblity via terminal commands (e.g. at krypted.com) but none of that did work. So I decided on checking the alternatives. And succeeded, thus this blog post.
OK, so here we go. The instructions given at krypted.com are correct, they just do not work from the console in El Capitan (or in my special configuration). But there is another way. We need to change the bluetooth plist file directly. I used the plist-Editor that is included in XCode, the Apple developer tools. If you do not have them installed, they are downloadable for free via the AppStore. You may use any other plist-editor out there, I did not check if it would work, but I am very confident that it should work.

First, check the UUID by opening a terminal window (I am using iTerm), and type

/usr/sbin/system_profiler SPHardwareDataType | grep "Hardware UUID" | cut -c22-57

The hexadecimal number you will get should match part of the plist-filename. In the terminal window type

cd Library/Preferences/ByHost/
ls -al com.apple.Bluetooth*

You should see two files. One with the extension “.plist”, the other with the extension “.lockfile”. Part of the filename is the aforementioned number.files_involved
If you do not see your Library folder, you need to enable it in the Finder options. In the Finder menu click “Go -> Home”, then again in the Finder menu click “View -> Show view options” and at the bottom of the window there is a checkbox “Show Library Folder”:
Screen Shot 2016-01-17 at 08.26.56
In Finder right click the Bluetooth plist file and select “Open with -> XCode”. This will start XCode (or, if you never used it, download some additional tools) and you can now edit the plist-file. Change “DiscoverableState” to “NO” and save the file. It should look like in the screenshot here:
xcode_plist

The only thing left to do ist unloading and reloading the Bluetooth service. This can be done from the Terminal:

sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist

If you now switch on Bluetooth and do an “ALT+click” on the Bluetooth icon in the menu bar, it should look like this:
bluetooth_alt_mouse
Voilà, Bluetooth discoverability is disabled and we can safely use Bluetooth keyboards without having the Mac been seen by everybody around. The discoverability will be set to “On” when you enable Bluetooth and the Bluetooth Preferences Pane from the System Preferences is open. After my modifications this worked just fine on my machine.

Advertisements

Comments are closed.