schollz / find3-cli-scanner

The command-line scanner that supports Bluetooth and WiFi
https://www.internalpositioning.com/doc/tracking_your_computer.md
149 stars 55 forks source link

Remove requirement of running scanner with sudo (somehow) #14

Open ferdydek opened 6 years ago

ferdydek commented 6 years ago

Expected Behavior

passive command should work without sudo:

nohup find3-cli-scanner -i wlan1 -device xxxxxxx -family yyyyyy-server http://192.168.1.111:8005 -scantime 10 -bluetooth -forever -passive -no-modify

however returns errors:

2018-07-16 18:25:56 [ERROR] utils.go RunCommand:40 exit status 1: btmgmt find
2018-07-16 18:25:56 [ERROR] utils.go RunCommand:40 exit status 1: service bluetooth restart

if I run the command with sudo, with latest tshark version I'd need to remove hardcoded root protection (recompile?)

Specifications

schollz commented 6 years ago

@ferdydek It doesn't work without sudo because you need sudo for scanning blueetooth with btmgmt and you need sudo for restarting bluetooth with service bluetooth restart.

Also, in some cases you need sudo for tshark (I think their are ways around this, depending on how you install tshark).

I'd love to know a way around this because running without sudo would be ideal, please make a PR!

Pimmetje commented 5 years ago

One option would be setting https://en.wikipedia.org/wiki/Setuid. But that could be a security implication.