- Troubleshoot, fix and enable Bluetooth on Kali Linux
- 2. Check if you have all core system packages in place
- 3. Be sure that your Bluetooth device is not blocked
- 3. Assure that Bluetooth service is started
- 4. Install blueman package
- 5. Conclusion
- Check also.
- 🐧 Как подключиться к устройству Bluetooth из терминала Linux
- Установка BlueZ на Linux
- Как выполнить сопряжение и подключиться к устройству Bluetooth
- Использование bluetoothctl для подключения к устройству Bluetooth
- Включите адаптер Bluetooth при запуске системы
Troubleshoot, fix and enable Bluetooth on Kali Linux
In this short tutorial, we’ll show how to enable Bluetooth on Kali Linux. We’ll go through the commons steps for setting up the Bluetooth and cover different situations and possible issues:
- check if you have all core system packages in place
- assure that your Bluetooth device is not blocked
- install Blueman package
- check service status and start it if it’s not already started
- potential issues and solutions:
- an issue with libgcc-9-dev package— to solve this issue check out this tutorial
2. Check if you have all core system packages in place
If you installed the basic/core version of Kali Linux, it’s good practice to do do the update and upgrade after the installation, so that you have a complete package list. For that purpose use the following commands:
sudo apt-get update sudo apt-get upgrade
If these commands results say that everything is up to date and you’re sure that you didn’t do any updates on your new system, check the contents of the /etc/apt/sources.list fille. For this purpose, you can use any text editor, for example, nano:
sudo nano /etc/apt/sources.list
In my case, I downloaded and installed a rolling release and I didn’t have any repositories configured. The contents of my sources.list file was as follows:
# deb cdrom:[Debian GNU/Linux 2019.4 _Kali-rolling_ - Official Snapshot am> #deb cdrom:[Debian GNU/Linux 2019.4 _Kali-rolling_ - Official Snapshot amd> # This system was installed using small removable media # (e.g. netinst, live or single CD). The matching "deb cdrom" # entries were disabled at the end of the installation process. # For information about how to configure apt package sources, # see the sources.list(5) manual.
deb http://http.kali.org/kali kali-rolling main non-free contrib
After I did this, I executed update&upgrade again, waited for a half an hour and in the end I actually had all things in place.
3. Be sure that your Bluetooth device is not blocked
Sometimes, it happens that the Bluetooth device itself is blocked/disabled. This could happen due to software or hardware reasons. To check the device status, use the rfkill list command:
0: ideapad_wlan: Wireless LAN Soft blocked: no Hard blocked: no 1: ideapad_bluetooth: Bluetooth Soft blocked: no Hard blocked: no 2: hci0: Bluetooth Soft blocked: no Hard blocked: no 3: phy0: Wireless LAN Soft blocked: no Hard blocked: no
Assure that the Bluetooth device you’re trying to use for the connection is not blocked. In case that it’s blocked, use the following command to unblock it:
sudo rfkill unblock bluetooth
For a more detailed tutorial on rfkill tool, check out this tutorial.
3. Assure that Bluetooth service is started
If your Bluetooth device was blocked/disabled, it’s a chance that the Bluetooth service is not started on your machine, so start it using:
sudo service bluetooth start
4. Install blueman package
Blueman is a Bluetooth manager with great UI that uses blueZ in the background. It will help you to easily manage your Bluetooth devices. If you don’t have it already, install it using
sudo apt-get install blueman
In this step, I had the issue with package versions saying:
After all of this goes fine, you’ll see the Bluetooth icon next to the clock and you’ll be able to connect and use your Bluetooth devices.
5. Conclusion
In this tutorial, we showed how to enable Bluetooth on Kali Linux and troubleshoot the issues.
Check also.
🐧 Как подключиться к устройству Bluetooth из терминала Linux
В этой статье мы обсудим, как вы можете управлять устройством Bluetooth с терминала Linux – дистрибутивов на основе Ubuntu, Debian, Fedora и Arch.
Беспроводная технология Bluetooth является всемирной спецификацией для недорогого решения радиосвязи с малым форм-фактором, которое обеспечивает связь между мобильными компьютерами, мобильными телефонами, другими портативными портативными устройствами и подключение к Интернету.
Спецификация разработана, опубликована и продвигается Специальной группой по интересам Bluetooth (SIG).
В этом руководстве мы будем использовать BlueZ, который обеспечивает поддержку основных уровней и протоколов Bluetooth.
Это гибкий, эффективный инструмент, который использует модульную реализацию. Он имеет следующие ключевые особенности.
- Полная модульная реализация
- С имметричная мульти-безопасная обработка
- Многопоточная обработка данных
- Поддержка нескольких устройств Bluetooth
- Реальная аппаратная абстракция
- Стандартный интерфейс сокетов для всех слоев
- П оддержка безопасности устройств и уровня обслуживания
Установка BlueZ на Linux
Установите пакеты BlueZ с помощью любой из следующих команд, соответствующих вашему дистрибутиву Linux.
----- Ubuntu / Debian ----- $ sudo apt-get -y install bluetooth bluez bluez-tools rfkill ----- Fedora ----- $ sudo dnf -y install bluez bluez-tools ----- Arch Linux / Manjaro ----- $ sudo pacman -S bluez bluez-utils
Эта установка предоставляет утилиту bluetoothctl.
Вам необходимо добавить свою учетную запись в группу lp, если вы хотите подключиться к Bluetooth-модему.
sudo usermod -aG lp $USER newgrp lp
$ systemctl is-enabled bluetooth.service enabled $ systemctl status bluetooth.service ● bluetooth.service - Bluetooth service Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2019-11-30 17:14:12 EAT; 3h 55min ago Docs: man:bluetoothd(8) Main PID: 1638 (bluetoothd) Tasks: 1 (limit: 18590) Memory: 2.3M CPU: 47ms CGroup: /system.slice/bluetooth.service └─1638 /usr/libexec/bluetooth/bluetoothd Nov 30 17:14:12 myfed.example.net systemd[1]: Starting Bluetooth service. Nov 30 17:14:12 myfed.example.net bluetoothd[1638]: Bluetooth daemon 5.52 Nov 30 17:14:12 myfed.example.net systemd[1]: Started Bluetooth service. Nov 30 17:14:12 myfed.example.net bluetoothd[1638]: Starting SDP server Nov 30 17:14:12 myfed.example.net bluetoothd[1638]: Bluetooth management interface 1.14 initialized Nov 30 21:07:52 myfed.example.net bluetoothd[1638]: Endpoint registered: sender=:1.77 path=/MediaEndpoint/A2DPSink/sbc Nov 30 21:07:52 myfed.example.net bluetoothd[1638]: Endpoint registered: sender=:1.77 path=/MediaEndpoint/A2DPSource/sbc
Как выполнить сопряжение и подключиться к устройству Bluetooth
Мы собираемся использовать интерфейс командной строки bluetoothctl tp bluez.
Если у вас есть альтернативный интерфейсный инструмент, такой как GNOME Bluetooth, вы можете использовать его.
Сначала убедитесь, что Bluetooth не отключен.
$ rfkill ID TYPE DEVICE SOFT HARD 0 bluetooth tpacpi_bluetooth_sw blocked unblocked 1 wlan phy0 unblocked unblocked
Подтвердите, что он разблокирован.
$ rfkill ID TYPE DEVICE SOFT HARD 0 bluetooth tpacpi_bluetooth_sw unblocked unblocked 1 wlan phy0 unblocked unblocked 2 bluetooth hci0 unblocked unblocked
Использование bluetoothctl для подключения к устройству Bluetooth
Это общий план сопряжения устройства с использованием bluetoothctl.
Запустите интерактивную команду bluetoothctl.
$ bluetoothctl Agent registered $ bluetoothctl show Controller 20:79:18:5E:4B:64 (public) Name: myfed.example.net Alias: myfed.example.net Class: 0x000c010c Powered: yes Discoverable: no DiscoverableTimeout: 0x00000000 Pairable: no UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb) UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) Modalias: usb:v1D6Bp0246d0534 Discovering: no Advertising Features: ActiveInstances: 0x00 SupportedInstances: 0x05 SupportedIncludes: tx-power SupportedIncludes: appearance SupportedIncludes: local-name
Введите help, чтобы получить список доступных команд.
Включите адаптер Bluetooth
[bluetooth]# agent KeyboardOnly Agent is already registered [bluetooth]# default-agent Default agent request successful [bluetooth]# power on Changing power on succeeded
# scan on Discovery started [CHG] Controller 20:79:18:5E:4B:64 Discovering: yes [NEW] Device 14:AB:C5:CC:C7:AB 14-AB-C5-CC-C7-AB [CHG] Device 14:AB:C5:CC:C7:AB TxPower: 8 [CHG] Device 14:AB:C5:CC:C7:AB Name: DESKTOP-N9GVMQ2 [CHG] Device 14:AB:C5:CC:C7:AB Alias: DESKTOP-N9GVMQ2 [CHG] Device 14:AB:C5:CC:C7:AB UUIDs: 0000110c-0000-1000-8000-00805f9b34fb [CHG] Device 14:AB:C5:CC:C7:AB UUIDs: 0000110a-0000-1000-8000-00805f9b34fb [CHG] Device 14:AB:C5:CC:C7:AB UUIDs: 0000110e-0000-1000-8000-00805f9b34fb [CHG] Device 14:AB:C5:CC:C7:AB UUIDs: 0000111f-0000-1000-8000-00805f9b34fb [CHG] Device 14:AB:C5:CC:C7:AB UUIDs: 0000111e-0000-1000-8000-00805f9b34fb [NEW] Device 5C:FB:7C:A4:13:C6 JBL Clip 3
[bluetooth]# pair 5C:FB:7C:A4:13:C6 Attempting to pair with 5C:FB:7C:A4:13:C6 [CHG] Device 5C:FB:7C:A4:13:C6 Connected: yes [CHG] Device 5C:FB:7C:A4:13:C6 UUIDs: 00001108-0000-1000-8000-00805f9b34fb [CHG] Device 5C:FB:7C:A4:13:C6 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb [CHG] Device 5C:FB:7C:A4:13:C6 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb [CHG] Device 5C:FB:7C:A4:13:C6 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb [CHG] Device 5C:FB:7C:A4:13:C6 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb [CHG] Device 5C:FB:7C:A4:13:C6 ServicesResolved: yes [CHG] Device 5C:FB:7C:A4:13:C6 Paired: yes Pairing successful # trust 5C:FB:7C:A4:13:C6 [CHG] Device 5C:FB:7C:A4:13:C6 Trusted: yes Changing 5C:FB:7C:A4:13:C6 trust succeeded # paired-devices Device 5C:FB:7C:A4:13:C6 JBL Clip 3 # devices Device 5C:FB:7C:A4:13:C6 JBL Clip 3
[bluetooth]# connect 5C:FB:7C:A4:13:C6 Attempting to connect to 5C:FB:7C:A4:13:C6 [CHG] Device 5C:FB:7C:A4:13:C6 Connected: yes Connection successful [JBL Clip 3]# info Device 5C:FB:7C:A4:13:C6 (public) Name: JBL Clip 3 Alias: JBL Clip 3 Class: 0x00200414 Icon: audio-card Paired: yes Trusted: yes Blocked: no Connected: yes LegacyPairing: no UUID: Headset (00001108-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb) ManufacturerData Key: 0x0057 ManufacturerData Value: 01 00 cb 0e d0 1e 03 01 . RSSI: -21 TxPower: 0
Включите адаптер Bluetooth при запуске системы
Чтобы включить адаптер Bluetooth при запуске системы, откройте файл конфигурации.
$ sudo vim /etc/bluetooth/main.conf
Добавьте строку AutoEnable=true