The Prophet ﷺ said, "A woman must not travel a distance of three days except in the company of a close male relative."
حدثنا عفان حدثنا حماد بن سلمة عن سهيل بن أبي صالح عن أبيه
عن النبي ﷺ قال لا تسافر امرأة مسيرة ثلاثة أيام إلا مع ذي رحم
Suyuti narrated something similar in Jami Saghir, with the wording, "A woman must not travel for three days except with a mahram," which Bukhari, Muslim, and Abu Dawud narrated from Ibn Umar, and he indicated that it is sahih.