Screen Capture on Mac 15 not working through SSH

Steps:

  1. Connect to Mac through ssh and execute “screencapture abc.jpg”
  2. It shows the attached popup, though we have added “ssh-keygen-wrapper” to control the computer in Privacy and Security->Accessibility and in Privacy and Security->Screen and System Audio recording in System Settings
  3. Ideally, we wouldn’t like to see this popup as we have given enough permissions to take the screenshot as mentioned above, same works fine in Mac14 and below versions
  4. Even upon clicking “Allow for one week”, new session of SSH will have this popup again.

Screen Capture on Mac 15 not working through SSH
 
 
Q