To us (saying): Waki' narrated to us (saying): Sufyan reported to us from 'Abdul-Malik bin 'Umair, from a freed slave of Rib'i bin Hirash, from Hudhaifah who said: "We were sitting with the Prophet SAW and he said: "I do not know how long I will be with you, so stick to the two after me,' and he signaled towards Abu Bakr and 'Umar- 'And act upon the guidance of 'Ammar, and whatever Ibn Mas'ud reports to you, then believe him.'"
Jami` at-Tirmidhi Book 49, Hadith 199