Take the following steps to restrict login as customer permissions:

1. Navigate to System> Permissions > User Roles.

 Magento 2 User Rule

2. Choose the existing role or create a new one.

Add New Role in Magento 2

3. Set Role Resources

Find checkboxes for Login As Customer in "Role Resources" tab and check permissions you want to add to this role. Then save. Magento 2 User Role Resources