We were with the Messenger of Allah ﷺ when he said, "Shall I inform you of the greatest of the major sins?" He said it three times. "Associating partners with Allah, disobedience to parents, and false testimony," or he said, "false speech."
كنا عند رسول الله ﷺ فقال: ألا أنبئكم بأكبر الكبائر؟ ثلاثا: الإشراك بالله، وعقوق الوالدين، وشهادة الزور أو قول الزور.
Bukhari narrated it in the Book of Testimonies (2654) through Bishr bin Mufaddal, and Muslim narrated it in the Book of Faith (143:87) through Ismail bin Ulaya, both of them from Saeed Jariri, who said, Abdul-Rahman bin Abu Bakra narrated to us, from his father, who said (then he mentioned it), and the wording given here is Muslim's.As for what was narrated from a man who said, "We were sitting with Abu Hurairah, and he said, I heard the Messenger of Allah ﷺ say, 'Whoever testifies against a Muslim with testimony he has no right to give, let him take his seat in the Fire'," this is daif. Ahmad narrated it (10617) from Yazid (Ibn Harun), who said, Juhayr bin Yazid Abdi informed us, from Khidash bin Ayyash, who said, "I was in a gathering in Kufa, and there was a man narrating," and he mentioned it. Abu Dawud Tayalisi also narrated it (2717) from Juhayr bin Yazid, from Abbas bin Khulays, from a man from the people of Kufa, who said, "I was in the gathering of Abu Hurairah," and he mentioned the hadith. In it there is an unnamed man, and Abbas bin Khulays is daif.However, Khatib narrated it in Tarikh Baghdad (5/69), and Ibn Abu Dunya narrated it in his book Al-Samt wa Hifz al-Lisan (258), both of them through Yazid bin Harun, from Juhayr bin Yazid, from Khidash, from Abu Hurairah, mentioning it without the intermediary. Khidash bin Ayyash is unknown, nobody has affirmed him as trustworthy except Ibn Hibban, and Ibn Hajar weakened him somewhat in Taqrib. Tirmidhi said, "He is unknown," as stated in Al-Mughni (1/209). So the hadith falls between being disconnected and being daif.As for his statement, "testifies against a Muslim with testimony," it means he testifies that the man is corrupt or something similar while the man is innocent of it, and this too is false testimony.