"Six years he shall serve" (Exodus 21:2). I might hear that any kind of labor is included; the verse teaches, "You shall not make him serve the service of a slave" (Leviticus 25:39). From here they said: he may not wash his master's feet, nor put on his sandals, nor carry his vessels to the bathhouse, nor support him by the waist when he climbs steps, nor carry him in a litter or chair or sedan as slaves do. The verse teaches, "and over your brothers, the children of Israel" (Leviticus 25:46) and so on. But concerning his son or his student he is permitted [to do these for the servant]. "Six years he shall serve" - I might hear both degrading and non-degrading labor; the verse teaches, "as a hired worker" (Leviticus 25:40). Just as you may not change a hired worker from his trade, so too a Hebrew servant you may not change from his trade. From here they said: his master may not teach him a trade that serves the public, such as a bathhouse attendant, barber, tailor, butcher, or baker. Rabbi Yose says: If his trade was already specialized in this, he may do it; but his master may not impose a change upon him. "As a hired worker, as a resident" and so on - just as a hired worker labors by day [and not by night], so too, and so on. Rabbi Yose says: It all depends on his trade. "And in the seventh" - the seventh from the sale, or only the seventh of the [sabbatical] years? The verse teaches, "six years he shall serve" - the seventh from the sale, not the seventh of the years. "He shall go out free" - why is it said? Because it says, "And when you set him free from you" (Deuteronomy 15:13), I might hear that he writes him a bill of release or gives him money and goes out; the verse teaches, "he shall go out free, for nothing" (Exodus 21:2).
What Labor a Master May Not Demand of a Hebrew Servant
Yalkut Shimoni on Torah 311:1
שֵׁשׁ שָׁנִים יַעֲבֹד, שׁוֹמֵעַ אֲנִי, כָּל עֲבוֹדָה בְּמַשְׁמָע. תַּלְמוּד לוֹמַר (ויקרא כה, לט) "לֹא תַעֲבֹד בּוֹ עֲבֹדַת עָבֶד". מִכָּאן אָמְרוּ. לֹא יִרְחַץ לוֹ רַגְלָיו, וְלֹא יִנְעֹל לוֹ סַנְדָּלָיו, וְלֹא יִטֹּל לְפָנָיו כֵּלִים לְבֵית הַמֶּרְחָץ, וְלֹא יִסְמֹךְ בְּמָתְנָיו כֵּיוַן שֶׁעוֹלֶה בְּמַעֲלֶה, וְלֹא יִטְּלוֹ לוֹ בְּפוּרִין וְלֹא בְּכִסֵּא וְלֹא בְּלַקְטְקָא כְּדֶרֶךְ שֶׁהָעֲבָדִים עוֹשִׂים. תַּלְמוּד לוֹמַר (שם, מו) "וּבְאַחֵיכֶם בְּנֵי יִשְׂרָאֵל" וְגוֹ'. אֲבָל בִּבְנוֹ וּבְתַלְמִידוֹ רַשַּׁאי. שֵׁשׁ שָׁנִים יַעֲבֹד, שׁוֹמֵעַ אֲנִי בֵּין עֲבוֹדָה שֶׁיֵּשׁ בָּהּ בִּזָיוֹן וּבֵין עֲבוֹדָה שֶׁאֵין בָּהּ בִּזָיוֹן, תַּלְמוּד לוֹמַר (שם, מ) "כְּשָׂכִיר", מַה שָׂכִיר אִי אַתָּה רַשַּׁאי לְשַׁנּוֹתוֹ מֵאֻמָּנוּתוֹ, אַף עֶבֶד עִבְרִי אִי אַתָּה רַשַּׁאי לְשַׁנּוֹתוֹ מֵאֻמָּנוּתוֹ. מִכָּאן אָמְרוּ, לֹא יְלַמְּדֶנּוּ רַבּוֹ אֻמָּנוּת שֶׁהִיא מְשַׁמֶּשֶׁת לָרַבִּים, כְּגוֹן בַּלָּן סַפָּר חַיָּט טַבָּח נַחְתּוֹם. רַבִּי יוֹסֵי אוֹמֵר, אִם הָיְתָה אֻמָּנוּתָן מְיֻחֶדֶת לְכָךְ, יַעֲשֶׂה. אֲבָל רַבּוֹ לֹא יְשַׁנֶּה עָלָיו. "כְּשָׂכִיר כְּתוֹשָׁב" וְגוֹ' מַה שָּׂכִיר עוֹבֵד בַּיּוֹם וְכוּ' אַף וְכוּ'. רַבִּי יוֹסֵי אוֹמֵר, הַכֹּל לְפִי אֻמָּנוּתוֹ. וּבַשְּׁבִעִת, שְׁבִיעִית לִמְכִירָה, אוֹ אֵינוֹ אֶלָּא שְׁבִיעִית לְשָׁנִים. תַּלְמוּד לוֹמַר שֵׁשׁ שָׁנִים יַעֲבֹד, שְׁבִיעִית לִמְכִירָה וְלֹא שְׁבִיעִית לְשָׁנִים. יֵצֵא לַחָפְשִׁי, לָמָּה נֶאֱמַר, לְפִי שֶׁהוּא אוֹמֵר (דברים טו, יג) "וְכִי תְּשַׁלְּחֶנּוּ חָפְשִׁי מֵעִמָּךְ", שׁוֹמֵעַ אֲנִי יִכְתֹּב לוֹ גֵּט שִׁחְרוּר אוֹ יִתֵּן לוֹ מָעוֹת וְיֵצֵא, תַּלְמוּד לוֹמַר יֵצֵא לַחָפְשִׁי חִנָּם.