The Messenger of Allah ﷺ said, "Indeed, I have been given the Book and along with it something similar to it. Soon a man will be reclining well-fed on his couch and will say, 'Stick to this Quran. Whatever you find permitted in it, treat as lawful, and whatever you find forbidden in it, treat as unlawful.' But indeed, the flesh of the domestic donkey is not lawful for you, nor is any predator with fangs, nor lost property belonging to a person under treaty unless its owner has no need of it. And whoever stops as a guest with a people, it is upon them to host him. If they do not host him, he has the right to take from them the equivalent of what they should have provided."
عن رسول الله ﷺ أنه قال: ألا إني أوتيت الكتاب ومثله معه، ألا يوشك رجل شبعان على أريكته يقول: عليكم بهذا القرآن، فما وجدتم فيه من حلال فأحلوه، وما وجدتم فيه من حرام فحرموه، ألا لا يحل لكم لحم الحمار الأهلي، ولا كل ذي ناب من السبع، ولا لقطة معاهد إلا أن يستغنى عنها صاحبها، ومن نزل بقوم فعليهم أن يقروه، فإن لم يقروه فله أن يعقبهم بمثل قراه.
Abu Dawud (4604) and Ahmad (17174) both narrated it through Hurayz bin Uthman, from Abdul-Rahman bin Abu Awf Jurashi, from Miqdam bin Maadi Kareeb, who mentioned it, and the wording is Abu Dawud's. This is a sahih chain. The hadith has other routes from Miqdam bin Maadi Kareeb.What is narrated from Awf bin Malik is not sahih. He said, the Messenger of Allah ﷺ came out to us at midday looking terrified, and said, "Obey me as long as I am among you, and hold fast to the signs of Allah, permit what He has permitted and forbid what He has forbidden." Tabarani narrated it in Al-Kabir (18/38) through Sulayman bin Abdul-Rahman Dimashqi, who said, Muawiya bin Salih narrated to us, from Muhammad bin Harb, from Buhayr bin Saad, from Khalid bin Madan, from Kathir bin Mura, from Naeem bin Hammar, from Miqdam bin Maadi Kareeb, from Abu Ayub Ansari, from Awf bin Malik, who mentioned it.Ibn Abu Hatim asked his father about this hadith, and he said, "This is a baatil hadith." Ilal Ibn Abu Hatim (1410).I say, its text is very strange, for the qualifying phrase "as long as I am among you" was never established in the sahih and firmly established hadiths concerning obedience to the Prophet ﷺ. Rather, the scholars are unanimously agreed that obedience to him ﷺ applies equally during his life and after his death. In its chain is Sulayman bin Abdul-Rahman Dimashqi, who is the son of the daughter of Shurahbil Dimashqi. He is truthful, but odd and baatil reports occurred in his hadith, and this is one of them.Also not sahih is what Ahmad (6605) narrated from Yahya bin Ishaq, who said, Ibn Lahia narrated to us, from Abdullah bin Hubayra, from Abdul-Rahman bin Shurayh Khawlani, who said, I heard Abu Qays, the freed slave of Amr bin As, say, I heard Abdullah bin Amr say, and he mentioned a hadith, at the end of which is, "So listen and obey as long as I remain among you. But when I am taken away, then hold fast to the Book of Allah, permit what it permits and forbid what it forbids." In its chain is Ibn Lahia, who has poor memory, and Abdul-Rahman bin Shurayh is majhul, as Abu Hatim said.