I am developing some code using the BlueZ Bluetooth stack and running it requires root privileges. As example running hcitool lescan
as normal user returns Set scan parameters failed: Operation not permitted
, which is also seen from my C++ code where hci_le_set_scan_parameters()
functions returns -1
.
The question Run a C++ program in Clion as root is about running C++ program as root in CLion on the local machine, which can be as simple as running the CLion as root.
I have configured Full Remote Mode with remote toolchain:
and then I'm using this same configuration for automatic deployment:
and then the Run/Debug Configurations are automatically run as this user on the remote machine.
I could replace Non-superuser user
in Deployment configuration with root
and probably solve the problem (by also giving root privileges to whole Remote Host Browser) - but is there any other way to achieve this any only run the built executable with sudo
?