The Gemara (43b) tells a story about Rav Hanilai’s son, Nehemya, who was so engrossed in his learning that he did not pay attention to where he was going and wandered beyond the 2,000- ama tehum on Shabbat. Upon noticing Nehemya’s predicament, Rav Hisda turned to Rav Nahman to ask what could be done to allow Nehemya to return to the city precincts. Rav Nahman suggested gathering a group of people who would make two rows of a “living chain” to where Nehemya was stranded – either (according to Rabbenu Yehonatan) non-Jews or (according to Rashi) people who had made an eiruv that allowed them to go beyond the tehum – allowing him to return, surrounded by these “walls.”
The suggestion that human beings can be used as walls for Shabbat purposes is questioned by Rav Nahman bar Yitzhak, who quoted a baraita to Rava which teaches that if one of the walls of a Sukka falls down, one is not permitted to have someone stand in its place and act as a wall, since erecting even a temporary wall on Shabbat or Yom Tov is forbidden. Rava counters this question with another baraita, one which teaches specifically that a person can ask his friend to stand in place of one of the Sukka walls in order to allow him to eat, drink or sleep in the Sukka!
The Gemara distinguishes between these two baraitot, saying that creating a wall out of people is only permitted if the participants are unaware of what is taking place (she’lo mi-da’at). If, however, they recognize the role that they are playing (mi-da’at), then the wall is not effective. The Gemara is then forced to acknowledge that the case of Nehemya who wandered out of the tehum must have been where the people were not aware of what was going on, and that Rav Hisda, who orchestrated the “human chain” wall did not, himself, participate in it.
But why distinguish between cases where the participants in the wall are aware or unaware of what is being accomplished? The impression given by Rashi and the Rashba. is that if someone knows what his role is in creating the wall, it is as if the wall is no longer a temporary one; rather, it takes on a certain element of permanence, which would be forbidden on Shabbat or Yom Tov. The Meiri argues that the problem is one of perception. If people recognize that a trick is being played in order to avoid a Shabbat problem, it will appear to them as desecration of the Shabbat, leading to a lessening of the honor of Shabbat.