How to disable bluetooth in Red Hat Enterprise Linux?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 5

Issue

  • Is there any way to disable bluetooth in Red Hat Enterprise Linux(RHEL) ?

Resolution

  • The Bluetooth kernel modules (bluetooth, bnep, btusb/hci_usb) are automatically loaded when the system boots and the Bluetooth service is enabled. The kernel modules can be prevented from being loaded by using system-wide modprobe rules.

  • Run the following commands to blocklist the Bluetooth modules, thus preventing them from loading if Bluetooth hardware is present:

On Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7 and Red Hat Enterprise Linux 8:

# echo "install bnep /bin/true" >> /etc/modprobe.d/disable-bluetooth.conf
​# echo "install bluetooth /bin/true" >> /etc/modprobe.d/disable-bluetooth.conf
​# echo "install btusb /bin/true" >> /etc/modprobe.d/disable-bluetooth.conf

On Red Hat Enterprise Linux 5:

# echo "install bnep /bin/true" >> /etc/modprobe.d/disable-bluetooth.conf
​# echo "install bluetooth /bin/true" >> /etc/modprobe.d/disable-bluetooth.conf
​# echo "install hci_usb /bin/true" >> /etc/modprobe.d/disable-bluetooth.conf
  • Additionally, once the kernel modules are disabled, if you have the bluez (Bluetooth utilities) package installed you will want to have the Bluetooth service disabled at startup.

On Red Hat Enterprise Linux 7 or 8 execute the following commands as root:

# systemctl disable bluetooth.service
# systemctl mask bluetooth.service
# systemctl stop bluetooth.service

On Red Hat Enterprise Linux 5 or 6 execute the following commands as root:

# chkconfig bluetooth off
# service bluetooth stop

NOTE:

  • If the above kernel modules are already loaded, you can manually unload them with the rmmod command. Depending on what Bluetooth hardware is discovered on the system, there is expected to be slight variations on which Bluetooth modules are loaded. The rmmod command will display information about additional Bluetooth modules loaded when attempting to use it. You will want to rmmod any additional Bluetooth modules it notifies you are also loaded. Execute the following as root to unload these modules from the running kernel:

On Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7 and Red Hat Enterprise Linux 8 :

# rmmod bnep
# rmmod bluetooth
# rmmod btusb

On Red Hat Enterprise Linux 5:

# rmmod bnep
# rmmod bluetooth
# rmmod hci_usb

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments