And since there is no Torah prohibition of techumin in seas and rivers according to everyone for the reasons that have been explained, therefore one who arrived in a ship on Shabbat and reached the port—he may disembark and need not refrain, and he has two thousand amot in every direction, because he did not acquire a shevitah while being in the ship. However, this is specifically when the ship traveled more than ten [tefachim] above the water. But if it traveled lower than ten, meaning that from the floor of the ship to the ground is not ten tefachim, even though he is high up on the ship—he acquired shevitah there. And when he goes outside of two thousand amot from that place—his law is like one who went outside the techum, and he has only four amot. And if it is a doubt whether it was lower than ten or higher than ten—we follow the lenient view. And if he disembarked once after dark onto the dry land and returned and entered the ship, when he arrives at any place on Shabbat—he has only four amot, for he already acquired shevitah in the first place where he went out onto the dry land, and even if he went out after dark not at the time of the acquisition of shevitah. The general rule of the matter: Anyone who was on Shabbat for one moment on dry land or lower than ten in the water—there is his shevitah, and when he returned to the ship and it reached the port—it is forbidden for him to go outside of four amot, and if this occurred—he must wait there until night. However, if he is forced to go out of the four amot, such as if rains are falling or the sun is shining upon him and he cannot endure it, or if he needs to relieve himself and is forced to enter the city—the entire city is for him like four amot, for "since he entered—he entered," and the details of this law will be explained in siman 405 and siman 406, and there is no need to elaborate here. Only one must know, that in walking outside the techum like this—we consider him like one under duress and not like one who went out intentionally, as there are distinctions in this as written there. And the laws of entering a ship on Shabbat and on Erev Shabbat were explained above in siman 248 and in siman 339. (And see Magen Avraham, subsection 5)
וכיון שאין בימים ונהרות איסור תחומין דאורייתא לדברי הכל מטעמים שנתבארו, לכן מי שבא בספינה בשבת והגיע לנמל - יורד ואינו נמנע, ויש לו אלפים אמה לכל רוח, לפי שלא קנה שביתה בהיותו בספינה. אך זהו דוקא כשהספינה הלכה למעלה מי' מן המים. אבל אם הלכה למטה מי', והיינו שאין מקרקע הספינה להארץ י' טפחים, אף על פי שהוא למעלה על הספינה - קנה שם שביתה, והיינו שאין מקרקע הספינה להארץ י' טפחים, אף על פי שהוא למעלה על הספינה קנה שם שביתה. וכשיצא חוץ לאלפים מאותו מקום - דינו כיצא חוץ לתחום, ואין לו אלא ד' אמות. ואם הוא ספק אם היה למטה מי' או למעלה מי' - אזלינן לקולא. ואם יצא פעם אחד משחשיכה על היבשה וחזר ונכנס לספינה, כשיבא לאיזה מקום בשבת - אין לו אלא ד' אמות, שהרי קנה שביתה במקום הראשון שיצא על היבשה, ואפילו יצא משחשיכה שלא בשעת קניית שביתה. כללו של דבר: כל שבשבת היה רגע אחת ביבשה או למטה מעשרה בהמים - שם שביתתו, וכשחזר לספינה והגיעה לנמל - אסור לו לצאת חוץ מד' אמות, ואם אירע כן - צריך להמתין שם עד הלילה. אך אם מוכרח לצאת מן הד' אמות, כגון שיורדין גשמים או החמה זורחת עליו ואינו יכול לסבול, או שצריך לנקביו ומוכרח ליכנס להעיר - הוה ליה כל העיר כד' אמות, ד'כיון דעל - על', ופרטי דין זה יתבארו בסימן ת"ה וסימן ת"ו, ואין להאריך בכאן. רק צריך לדעת, דבהילוך חוץ לתחום כזה - חשבינן ליה כאונס ולא כיוצא לדעת, שיש חילוקים בזה כמ"ש שם. ודיני כניסה לספינה בשבת ובערב שבת נתבאר לעיל בסימן רמ"ח ובסימן של"ט. (ועיין מג"א סק"ה)