The Messenger of Allah ﷺ took hold of part of my body and said, "Abdullah, be in this world as though you were a stranger or a wayfarer, and count yourself among the people of the graves."
حدثنا يحيى بن حبيب بن عربي حدثنا حماد بن زيد عن ليث عن مجاهد
أخذ رسول الله ﷺ ببعض جسدي فقال يا عبد الله كن في الدنيا كأنك غريب أو كأنك عابر سبيل وعد نفسك من أهل القبور
[Its chain is daif] Tirmidhi transmitted it in Zuhd, chapter on what has been said about shortening hope, no. 2333, from the hadith of Hammad, with this wording. Layth bin Abu Salim, his status was mentioned earlier at no. 208. Bukhari transmitted it in his Sahih, in Riqaq, chapter on the Prophet's saying, "Be in this world as if you were a stranger or a passer-by," no. 6416, through another route from Mujahid, with this wording, but without his statement "and count yourself among the people of the graves," and that is the preserved version.