Abdul-Rahman bin Abd Rabb Kaaba reported,

I came to Abdullah bin Umar while he was sitting in the shade of the Kaabah with people gathered around him. I heard him say:While we were with the Messenger of Allah ﷺ on a journey, we stopped at a place. Some of us were pitching tents, some were practicing archery, and some were tending to their grazing livestock, when the Prophet's caller announced, "The prayer is gathering."We assembled, and the Prophet ﷺ stood and addressed us, saying, "There has been no prophet before me except that it was his duty to guide his nation to what he knew was good for them and to warn them against what he knew was evil for them. As for this nation of yours, its well-being has been placed in its earliest period, and its later generations will be afflicted with trials and matters they will find objectionable. Tribulations will come, each one making the previous seem light. A trial will come and the believer will say, 'This will be my destruction,' then it will lift. Then another will come and he will say, 'This will be my destruction,' then it will lift.So whoever among you wishes to be removed from the Fire and admitted to Paradise, let his death come while he believes in Allah and the Last Day, and let him treat people the way he would love to be treated. Whoever pledges allegiance to a leader, giving him his hand and the sincerity of his heart, let him obey him to the best of his ability. If another comes to dispute his authority, then strike the neck of that other one."I drew near to him and said, "Did you hear the Messenger of Allah ﷺ say this?"He replied, "Yes," and continued narrating the hadith.

Nasai 4196

Sahih

أخبرنا هناد بن السري عن أبي معاوية عن الأعمش عن زيد بن وهب

عن عبد الرحمن بن عبد رب الكعبة قال

انتهيت إلى عبد الله بن عمرو وهو جالس في ظل الكعبة والناس عليه مجتمعون قال فسمعته يقول بينا نحن مع رسول الله ﷺ في سفر إذ نزلنا منزلا فمنا من يضرب خباءه ومنا من ينتضل ومنا من هو في جشرته إذ نادى منادي النبي ﷺ الصلاة جامعة فاجتمعنا فقام النبي ﷺ فخطبنا فقال إنه لم يكن نبي قبلي إلا كان حقا عليه أن يدل أمته على ما يعلمه خيرا لهم وينذرهم ما يعلمه شرا لهم وإن أمتكم هذه جعلت عافيتها في أولها وإن آخرها سيصيبهم بلاء وأمور ينكرونها تجيء فتن فيدقق بعضها لبعض فتجيء الفتنة فيقول المؤمن هذه مهلكتي ثم تنكشف ثم تجيء فيقول هذه مهلكتي ثم تنكشف فمن أحب منكم أن يزحزح عن النار ويدخل الجنة فلتدركه موتته وهو مؤمن بالله واليوم الآخر وليأت إلى الناس ما يحب أن يؤتى إليه ومن بايع إماما فأعطاه صفقة يده وثمرة قلبه فليطعه ما استطاع فإن جاء أحد ينازعه فاضربوا رقبة الآخر فدنوت منه فقلت سمعت رسول الله ﷺ يقول هذا قال نعم وذكر الحديث

النسائي 4196صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Pledge of allegiance
Chapter
Duty of one who pledges allegiance to the Imam and gives him the handshake of his hand and the sincerity of his heart
Numbering
Darussalam 4196
Nasai 4196