The Messenger of Allah ﷺ said, "It is not right for any Muslim man who has something to bequeath to spend two nights without having his will written down with him."
أخبرنا قتيبة بن سعيد قال حدثنا الفضيل عن عبيد الله عن نافع
قال رسول الله ﷺ ما حق امرئ مسلم له شيء يوصى فيه أن يبيت ليلتين إلا ووصيته مكتوبة عنده
Muslim narrated it in the Book of Wills, chapter on a man's will being written down with him, hadith 1/1627, from the hadith of Ubaydullah bin Umar, and it is in Al-Kubra, hadith 6442, and its basis is agreed upon by Bukhari and Muslim (see the following hadith).Fudayl is Ibn Ayyad al-Yarbui.