Urwah (may Allah have mercy on him) said that the Messenger of Allah (peace and blessings be upon him) said to Abdur-Rahman bin Awf (may Allah be pleased with him) on the occasion of the Farewell Hajj: "O Abu Muhammad, how do you do it?" He replied: I touch it (the Black Stone) sometimes and sometimes I leave it. He (peace and blessings be upon him) said: "You do right."
Imam al-Shafi'i (may Allah have mercy on him) said: I think the Prophet (peace and blessings be upon him) said to Abdur-Rahman, "You did right," praising him because he touched it when there was no crowd and left it when there was a crowd.
This narration is mursal.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحج / 9263