Conexión de teclado Bluetooth por CLI a Ubuntu
You can try running bluetoothctl from the command line, make sure your device is on / ready to be discovered:
$ bluetoothctl
[NEW] Controller AA:BB:CC:DD:EE:FF device-name [default]
Any other bluetooth devices will be listed here. You'll then be inside a [bluetooth] prompt.
First, turn bluetooth power on (if your device is off):
[bluetooth]# power on
Changing power on succeeded
Then, make sure your agent is registered:
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
Now you can scan for devices from the console:
[bluetooth]# scan on
Discovery started
[CHG] Controller AA:BB:CC:DD:EE:FF Discovering: yes
[NEW] Device FF:EE:DD:CC:BB:AA Someone's Keyboard
You can manually pair from here as well:
[bluetooth]# pair FF:EE:DD:CC:BB:AA
Attempting to pair with FF:EE:DD:CC:BB:AA
[CHG] Device C8:E0:EB:04:52:55 Connected: yes
At this point, you should be prompted to enter a pin code for pairing:
Request PIN code
[agent] Enter PIN code: 12345
Enter a number (eg. 12345), and you will be prompted to input the same number from the device:
[Someone's Keyboard]# 12345
You should then be notified that your keyboard has paired:
[CHG] Device FF:EE:DD:CC:BB:AA Paired: yes
Hopefully this works for you, was trying to solve this for a while before I found any reference to bluetoothctl.
At the end, just trust the device
[bluetooth]# trust FF:EE:DD:CC:BB:AACopiado de:
https://askubuntu.com/questions/701978/how-can-a-bluetooth-keyboard-that-requires-a-code-entry-be-paired-in-the-termina