Bluetooth Linux Fix
Are you facing Bluetooth pairing issues on your Linux system? This guide will help you resolve these problems by configuring Bluetooth for seamless, passwordless pairing and auto-pairing, improving convenience.
I found this solution while referring to the ArchLinux wiki on pairing gamepads via Bluetooth.
Why This Matters
Bluetooth pairing without a PIN is very convenient, especially for devices like gamepads and headsets. However, it’s crucial to understand the security implications and ensure your setup doesn’t compromise your system’s security.
As of 2024-03-09, BlueZ has set ClassicBondedOnly
and UserspaceHID
to true
by default for security reasons. This change can cause pairing issues with certain devices, such as controllers. To enable passwordless pairing, we need to set these values to false
.
Step-by-Step Guide
1. Edit the Configuration File
Open or create the Bluetooth configuration file with root privileges using your preferred text editor. For example, using nano
:
1
sudo nano /etc/bluetooth/input.conf
2. Update Configuration Settings
Add the following lines to the Bluetooth configuration file:
1
2
ClassicBondedOnly=false
UserspaceHID=false
ClassicBondedOnly=false: Allows classic Bluetooth devices to pair without requiring a PIN. This setting is typically
true
for security reasons, but setting it tofalse
enables easier pairing. Here’s the refined statement:UserspaceHID=false: Disables the default
true
setting, allowing controllers to enter operational mode and enabling passwordless pairing, which is crucial for auto-pairing functionalities.
3. Save and Apply Changes
Save the file (Ctrl+O
in nano) and exit the editor (Ctrl+X
).
4. Restart Bluetooth Services
Restart the Bluetooth service and adapter to apply the changes:
1
2
sudo systemctl restart bluetooth.service
sudo hciconfig hci0 reset
Security Considerations
While enabling auto-pairing without a PIN enhances convenience, it also introduces significant security risks. For this reason, in BlueZ, auto-pairing is not enabled by default, and passwordless authentication is disabled.
Unauthorized Access: Keep your Bluetooth device undiscoverable when not actively pairing to prevent unauthorized access. Devices left discoverable can be vulnerable to unauthorized connections, especially in public or unsecured environments.
Environment Suitability: This setup is primarily suitable for personal devices and environments where security risks are minimal. In more secure environments or with sensitive data, consider maintaining stricter authentication measures.
Note: Disabling
ClassicBondedOnly
and adjustingUserspaceHID
reduces security by allowing devices to pair without authentication. This setting can also impact the operational mode for controllers, potentially affecting their functionality. Always weigh the convenience of passwordless pairing against the security implications based on your specific use case and security requirements.
Conclusion
This guide provides a straightforward method to fix Bluetooth pairing issues on Linux by configuring passwordless authentication and enabling auto-pairing when needed.
If you encounter issues or need further assistance, feel free to seek additional support.
Happy connection!