Adding User to Required Group
By default, the Bluetooth daemon will only give out Bluetooth devices to users that are a member of the lp group. We need to make sure to add our current user to the lp group to connect to a Bluetooth tether.
Firstly, we check the allocated groups to the user.
id prints information about the given user, or the process running it if no user is specified.
$ id
If lp is not present in the output list, we need to add the current user to the lp group
$ sudo usermod -aG lp $USER $ newgrp lp $ id # to check newly added group
- sudo allows the user to run commands with the privileges of a superuser.
- usermod command (Modify User) is used to change the properties of a user.
- In the -aG flag, -a appends the user to the mentioned groups, and -G gives a list of supplementary groups of which the user is also a member.
- The usermod -G command replaces the groups that were there before unless you add the -a (for append) flag.
- $USER returns the current username.
Connecting To Bluetooth Devices Via CLI
The Bluetooth wireless technology is a worldwide specification for a small-form-factor, low-cost radio solution that provides links between mobile computers, mobile phones, and other portable handheld devices. You’ll find Bluetooth connectivity in smartphones, smartwatches, wireless earphones, etc.
In this article, we’ll be learning how to connect to a Bluetooth Device via CLI on Linux.