It is narrated from Nafi' (may Allah have mercy on him) that Sayyiduna Ibn Umar (may Allah be pleased with them both) used to kill all the snakes that live in houses, until Sayyiduna Abu Lubabah bin Abd al-Mundhir (may Allah be pleased with him) told him that the Messenger of Allah (peace and blessings be upon him) had forbidden killing the snakes that live in houses. After that he gave it up, and he continued to kill the other snakes.
Hadith Referenceالمعجم الكبير للطبراني / باب الراء / 4493