The Messenger of Allah ﷺ said, "Do not swear by your fathers, nor by your mothers, nor by rivals set up beside Allah. Do not swear except by Allah, and do not swear by Allah unless you are truthful."
قال رسول الله ﷺ: لا تحلفوا بآبائكم، ولا بأمهاتكم، ولا بالأنداد، ولا تحلفوا إلا بالله، ولا تحلفوا بالله إلا وأنتم صادقون.
It was narrated by Abu Dawud (3248) and Nasai (3769), and Ibn Hibban graded it sahih (4357), all of them through the hadith of Ubaydullah bin Muaz bin Muaz, who said, my father narrated to us, he said, Awf narrated to us, from Ibn Sirin, from Abu Hurairah, and he related it. Its chain is sahih. Awf is Ibn Abu Jamilah al-Arabi al-Abdi, one of the men agreed upon by the compilers.A note of caution, in the hadith about the story of the Bedouin from the people of Najd who asked the Messenger of Allah ﷺ about the pillars of Islam, when the man turned away he was saying, "By Allah, I will not add to this nor take away from it," and the Messenger of Allah ﷺ said, "He has succeeded if he is truthful."This is how the two sheikhs, Bukhari (46) and Muslim (8:11), narrated it, through the hadith of Malik bin Anas, from his uncle Abu Suhayl bin Malik, from his father, that he heard Talha bin Ubaydullah say, "A man from the people of Najd came," and he related the hadith. Then Muslim narrated it through the hadith of Ismail bin Jafar, from Abu Suhayl, from his father, from Talha bin Ubaydullah, and he related the hadith similarly to Malik's version, except that he said, the Messenger of Allah ﷺ said, "He has succeeded, by his father, if he is truthful, or he has entered Paradise, by his father, if he is truthful."His saying "by his father" is an anomalous addition, and the preserved version is that of Malik. Ibn Abdul-Barr points to this in Tamhid (14/367) where he says, "If someone argues using a hadith reported from Ismail bin Jafar, from Abu Suhayl Nafi bin Malik bin Abu Amir, from his father, from Talha bin Ubaydullah, in the story of the Bedouin from Najd, that the Prophet ﷺ said, 'He has succeeded, by his father, if he is truthful,' the response is that this wording is not preserved in this hadith from anyone whose narration is relied upon. Malik and others narrated this hadith from Abu Suhayl and did not say that in it. This hadith has also been narrated from this same Ismail bin Jafar with the wording, 'He has succeeded, by Allah, if he is truthful, or he has entered Paradise, by Allah, if he is truthful,' and this is more fitting than the narration of whoever narrated 'by his father,' because that is an objectionable wording rejected by the sahih reports. And with Allah lies success."Ibn Hajar mentioned in Fath al-Bari (1/107) other interpretations, though none of them is satisfactory.