Abu Juhaym reported that the Messenger of Allah ﷺ came from the direction of Bir al-Jamal, and a man met him and greeted him with salam, but the Messenger of Allah ﷺ did not return his greeting until he turned to a wall and wiped his face and hands, then he returned the greeting.
أخبرنا الربيع بن سليمان قال حدثنا شعيب بن الليث عن أبيه عن جعفر بن ربيعة عن عبد الرحمن بن هرمز عن عمير مولى ابن عباس أنه سمعه يقول أقبلت أنا وعبد الله بن يسار مولى ميمونة حتى دخلنا على
أبو جهيم أقبل رسول الله ﷺ من نحو بئر الجمل ولقيه رجل فسلم عليه فلم يرد رسول الله ﷺ عليه حتى أقبل على الجدار فمسح بوجهه ويديه ثم رد عليه السلام
Bukhari transmitted it in Sahih Bukhari, Tayammum, chapter on tayammum while in one's hometown when water cannot be found and one fears missing the prayer, hadith no. 337, and Muslim in Hayd, chapter on tayammum, hadith no. 369, and it is also in Sunan al-Kubra, hadith no. 307.