Muhammad says a woman should not travel without a male custodian

In Sahih al-Bukhari, the most canonical hadith collection:

Volume 4, Book 52, Number 250:
Narrated Ibn Abbas:

That he heard the Prophet saying, "It is not permissible for a man to be alone with a woman, and no lady should travel except with a Muhram
[legal custodian] (i.e. her husband or a person whom she cannot marry in any case for ever; e.g. her father, brother, etc.)." Then a man got up and said, "O Allah's Apostle! I have enlisted in the army for such-and-such Ghazwa [raid or battle] and my wife is proceeding for Hajj [pilgrimage]." Allah's Apostle said, "Go, and perform the Hajj with your wife."