How can I permit SSH connection terminal programs to access Camera?
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?
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