He opened a door and a snake came out of it. He ordered that it be killed, but Abu Lubabah said to him, "Do not do that, for the Messenger of Allah ﷺ forbade killing the snakes that live in houses."
حدثنا محمد بن عبيد قال حدثنا عبيد الله عن نافع
أنه فتح بابا فخرجت منه حية فأمر بقتلها فقال له أبو لبابة لا تفعل فإن رسول الله ﷺ قد نهى عن قتل الحيات التي تكون في البيوت
Its isnad is sahih. Ubaydullah is the son of Abdullah bin Umar, and he is trustworthy.