Bulugh al-Maram, Book 6, Hadith 43 (In-Book)

'Umar (RAA) narrated that he kissed the Black Stone and said, ‘I know that you are a stone and can neither benefit anyone nor harm anyone. Had I not seen Allah’s Messenger kissing you, I would not have kissed you.’ Agreed upon.

وَعَنْ عُمَرَ ‏- رضى الله عنه ‏- { أَنَّهُ قَبَّلَ اَلْحَجَرَ [ اَلْأَسْوَدَ ] فَقَالَ: إِنِّي أَعْلَمُ أَنَّكَ حَجَرٌ لَا تَضُرُّ وَلَا تَنْفَعُ, وَلَوْلَا أَنِّي رَأَيْتُ رَسُولَ اَللَّهِ ‏- صلى الله عليه وسلم ‏-يُقَبِّلُكَ مَا قَبَّلْتُكَ } مُتَّفَقٌ عَلَيْهِ 1‏.‏ ‏1 ‏- صحيح.‏ رواه البخاري ( 1597 )‏، ومسلم ( 1270 )‏، واللفظ للبخاري.‏

sunnah.com

also referenced under: Book 6, Hadith 770 (English)