2

I'm connecting to my macOS 10.15.1 device over SSH via PuTTY on a Windows computer to run a terminal program, imagesnap, that attempts to use the MacBook's camera.

When I ran the program locally on command-line on a Terminal the first time I got a permission pop-up that allowed me to give Terminal access to Camera in the Security & Privacy settings.

When I run the same program on command-line via an SSH connection the program aborts without successfully taking a photo, and I receive no permission request for Camera access.

When I look at the section Camera in the Security & Privacy settings after trying to run the program using SSH there are no entries besides Terminal, which was already given access. Terminal is shown marked as having Camera access, so it and SSH programs are separate considerations for Security & Privacy.

How do I give my SSH connection programs Camera access?

1 Answer 1

2

You can access the list of permissions in System Preferences => Security & Privacy. Select the Privacy tab and then choose Camera in the list on the left. You can then checkmark the apps on the right that you want to have access to the camera.

If you have previously denied access to a program, it should appear here where you can checkmark it to allow access again.

As you're running a command line program from within the Terminal, it is Terminal.app that appears in the list on the right - and this is the program that needs to be checkmarked.

UPDATE: After your edit I realize that your problem is specifically when run via SSH, and not in general via the command line. In that case try prefixing your command with the "open" command.

For example like this:

open -a /Path/To/imagesnap /Path/To/imagesnap
14
  • When viewing System Preferences => Security & Privacy => Camera, only the Terminal appears in the list, and it has been checked off as yes for access to the Camera. I haven't denied SSH programs access to the camera in the past, and don't receive a pop-up requesting Camera access privileges when running the program that attempts to open the Camera via SSH, so Terminal remains the only entry in the Camera privacy list.
    – esarkis
    Commented Dec 10, 2019 at 13:40
  • Yes, then you have set everything up correctly!
    – jksoegaard
    Commented Dec 10, 2019 at 14:13
  • For sessions logged in from remote (which seems to be what the OP is doing) Terminal isn't involved so granting Camera access to Terminal won't help.
    – nohillside
    Commented Dec 10, 2019 at 14:22
  • Yes, my issue is using the Camera from programs over an SSH connection. A local Terminal behaves as expected. I've updated my post to make this as clear as possible.
    – esarkis
    Commented Dec 10, 2019 at 14:45
  • Ah, I see your problem now - please try the suggestion I have added (using the open command to force it opened as a GUI application).
    – jksoegaard
    Commented Dec 10, 2019 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .