toy / blueutil

CLI for bluetooth on OSX: power, discoverable state, list, inquire devices, connect, info, …
https://github.com/toy/blueutil
Other
969 stars 52 forks source link

Certain flags do not work over ssh #85

Closed jwhite007 closed 3 months ago

jwhite007 commented 3 months ago

blueutil v2.9.1 installed via Homebrew on Sonoma 14.4

Firstly, I'd like to thank the developer(s) for this wonderful tool.

I've used blueutil in the past over ssh without issue. In fact, that is my main use case for blueutil. If I want to connect to a bluetooth device from a local mac but another mac in another room is connected, it's much easier just to ssh into that other mac and disconnect the bluetooth device so that I can connect on the local mac. For some reason, this latest version is not fully functional over ssh, though.

Of the flags that I've tried, the following do not work.

$ blueutil --paired  # returns nothing even when local it returns values
$ blueutil --connected  # returns nothing even when local it returns values
$ blueutil --disconnect <ID>   # hangs

the following works

$ blueutil -p
1
toy commented 3 months ago

Thank you and glad it was (and hopefully will be) useful!

I suspect that os privacy restrictions are causing this. They are inherited from the ancestor which is the child of launchd, so for terminal you must have permission to use bluetooth, but not for sshd. If this is the case, you need to add sshd to the list and give it permission, then restart sshd and you should be able to have same access as from terminal.

jwhite007 commented 3 months ago

@toy ,

Thanks for the reply; however, it doesn't work for me.

Screenshot 2024-03-12 at 17 27 56

followed by:

$ sudo launchctl unload  /System/Library/LaunchDaemons/ssh.plist
$ sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
toy commented 3 months ago

After some checking it maybe not sshd itself, but sshd-keygen-wrapper (/usr/libexec/sshd-keygen-wrapper) that you need to add and grant access to

jwhite007 commented 3 months ago

@toy ,

That did the trick. Thank you, sir, for all that you've done with blueutil.

milindprajapati commented 2 months ago

@toy

Thanks this helps. Although when I run inquiry, it get stuck and shows 2024-04-11 11:21:33.699 blueutil[6056:425757] -[IOBluetoothDeviceInquiry initWithDelegate:] - 0x600003244030 Would you be able to help me out?

toy commented 2 months ago

@milindprajapati I've answered in #60