Restrict viewing front end to specific group permissions
If you setup a User Group with the same handle as the Site you want them to have access to, this could be fairly easy.
Let's say you have a site called &quot;Acme&quot; setup in the Sites settings. You also created a corresponding User Group called &quot;Acme.&quot; The handles for the Acme Site and Acme User Group are both &quot;acme.&quot;
When you're on the Acme site's front-end, possibly example.com/acme depending on how you set up your site URLs, the {{ currentSite.handle }} tag will return acme.
To test if a user has access to content in your template you can use something like {% if currentUser.isInGroup(currentSite.handle) %}.
Adding this to any template will prevent unauthorized access if a user is not in a group:
{% if not currentUser.isInGroup(currentSite.handle) %}  
  {% exit 403 %}
{% endif %}

You would also probably want to allow admins or users groups who can access the control panel:
allow admins:

{% if not currentUser.isInGroup(currentSite.handle) or not currentUser.admin %}  
  {% exit 403 %}
{% endif %}

... or allow any user that can access the control panel:

{% if not currentUser.isInGroup(currentSite.handle) or not currentUser.can('accessCp') %}  
  {% exit 403 %}
{% endif %}

Redirecting to the correct site after a login page is a little trickier because users can belong to more than one group.
But assuming that users only belong to one group you could redirect users to a sort of &quot;routing&quot; template that's only job is to send you to the right place.
{% set firstGroup = currentUser.getGroups()[0] ?? null %}

{% if firstGroup %}
  {% redirect firstGroup.handle %}
{% else %}
  ... default redirect or error 
{% endif %}

Also, here's a list of permission you can use with the currentUser.can() method:
https://docs.craftcms.com/v3/users.html#permissions