Sahih Bukhari Volume 4, Book 54, Hadith Number 529.

Narated By Abu Mulaika : Ibn Umar used to kill snakes, but afterwards he forbade their killing and said, “Once the Prophet pulled down a wall and saw a cast-off skin of a snake in it. He said, ‘Look for the snake. ‘They found it and the Prophet said, “Kill it.” For this reason I used to kill snakes. Later on I met Abu Lubaba who told me the Prophet said, ‘Do not kill snakes except the short-tailed or mutilated-tailed snake with two white lines on its back, for it causes abortion and makes one blind. So kill it.'”