Sayyiduna Ibn Ujrah al-Ansari (may Allah be pleased with him) says: We were nine men in the mosque. The Prophet (peace and blessings be upon him) came and said: "Do you hear? Do you hear?" He said it three times, then said: "Soon there will be rulers over you; whoever goes in to them and affirms them—" and the rest is as in the previous narration.
Sayyiduna Sahl bin Sa'd (may Allah be pleased with him) says that the Prophet (peace and blessings be upon him) said to his Companions: "How will you be when you remain among the dregs of people whose trusts and covenants have become corrupted, and they have become like this?" Then he interlaced his fingers. They asked: O Messenger of Allah (peace and blessings be upon him), what should we do at that time? He said: "Take what you recognise as good and leave what you find objectionable." Then Sayyiduna Abdullah bin Amr bin al-As (may Allah be pleased with them both) asked him privately: What do you command me to do at that time? He said: "I advise you to fear Allah, to keep control of your own self, and to keep yourself away from the affairs of the public."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قتال أهل البغي / 16669