The Messenger of Allah ﷺ was at al-Baqi when a man called out to another, "Abu Qasim!" The Messenger of Allah ﷺ turned toward him, but the man said, "I did not mean you."The Messenger of Allah ﷺ then said, "Name yourselves by my name, but do not take my kunya as your own."
حدثنا أبو بكر بن أبي شيبة حدثنا عبد الوهاب الثقفي عن حميد
كان رسول الله ﷺ بالبقيع فنادى رجل رجلا يا أبا القاسم فالتفت إليه رسول الله ﷺ فقال إني لم أعنك فقال رسول الله ﷺ تسموا باسمي ولا تكنوا بكنيتي
Bukhari narrated it, in the Book of Business Transactions, Chapter on What Has Been Mentioned Concerning Markets, hadith no. 2120, 2121, 3537, and Muslim, in the Book of Manners, Chapter on the Prohibition of Using Abu Qasim as a Kunya, and so on, hadith no. 2131, from the hadith of Humayd, with this wording.