The Messenger of Allah ﷺ said, "Hosting a guest for a night is an obligation upon every Muslim. If a guest spends the night in his courtyard and is denied hospitality, it becomes a debt owed to him. If he wishes, he may claim it, and if he wishes, he may forgive it."
حدثنا زياد بن عبد الله البكائي قال حدثنا منصور عن عامر
قال رسول الله ﷺ ليلة الضيف واجبة على كل مسلم فإن أصبح بفنائه محروما كان دينا له عليه إن شاء اقتضاه وإن شاء تركه
Its chain of transmission is sahih. Ziyad bin Abdullah Bakkai Amiri was a scholar of the military expeditions, trustworthy, and his hadith appears in Muslim and Bukhari as a corroborating narration. Amir is Shaybi.