2,266. Teachers and Yichud

Hilchos Issurei Biah 22:12

If a married woman’s husband is in town, she need not be concerned about being alone with another man because fear of her husband will be upon her. If a man is particularly familiar with her, such as if they grew up together or they’re related, then she may not be alone with him even if her husband is in town. If a man enters a room with a woman but there’s a door open to a public thoroughfare, we are not concerned about them being alone together.

Hilchos Issurei Biah 22:13

An unmarried man may not be a teacher for young children because their mothers bring them to school and he will be tempted by them. Similarly, a woman should not teach young boys because their fathers come to school and they will end up being alone together with her. A teacher doesn’t need his wife to be in school with him; it’s enough that she’s at home while he’s teaching.