New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Reply To: Auto-confirming Bluetooth pairing on a headless Pi 3

Translated from Türkçe by AI ·

I did the same thing in the lab, there are two separate issues.For pairing, run bt-agent from the bluez-tools package in NoInputNoOutput mode. In this mode no passkey is requested:

sudo apt install bluez-tools
# /etc/systemd/system/bt-agent.service
[Service]
ExecStart=/usr/bin/bt-agent -c NoInputNoOutput
Restart=always
[Install]
WantedBy=multi-user.target

Because of what Ms. Derya said, I didn’t keep the device visible all the time. There is a small script that runs bluetoothctl discoverable on and pairable on for 2 minutes when a button on the panel is pressed, and turns both off when the time is up.The reason getty doesn’t appear on the SPP side is most likely that bluetoothd is not running in compatibility mode. On Bookworm the SPP profile is not registered by default. Start bluetoothd with -C, then add the serial port:

# /etc/systemd/system/bluetooth.service.d/override.conf
[Service]
ExecStart=
ExecStart=/usr/libexec/bluetooth/bluetoothd -C

sudo sdptool add SP
sudo rfcomm watch hci0 1 getty rfcomm0 115200 vt100

After entering the token, don’t leave it on the screen. And if it stayed on a technician’s tablet, it’s a good idea to rotate it later from Hermetry.

Accepted solution♥ 5