كتاب الأشربة
36  
The Book of Drinks
(12)
Chapter: It is recommended to cover vessels, tie up waterskins, close doors and mention the name of Allah over them, extinguish lamps and fires when going to sleep, and keep children and animals in after maghrib
(12)
باب الأَمْرِ بِتَغْطِيَةِ الإِنَاءِ وَإِيكَاءِ السِّقَاءِ وَإِغْلاَقِ الأَبْوَابِ وَذِكْرِ اسْمِ اللَّهِ عَلَيْهَا وَإِطْفَاءِ السِّرَاجِ وَالنَّارِ عِنْدَ النَّوْمِ وَكَفِّ الصِّبْيَانِ وَالْمَوَاشِي بَعْدَ الْمَغْرِبِ
Sahih Muslim 2012 a

Jabir reported Allah's Messenger (ﷺ) as saying:

Cover vessels, waterskins, close the doors and extinguish the lamps, for the Satan does not loosen the waterskin, does not open the door and does not uncover the vessels. And if one amongst you fails to find (something) to cover it well, he should cover it by placing (a piece of) wood across it. Qutaiba did not mention the closing of the doors in the hadith transmitted by him.
حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، ح وَحَدَّثَنَا مُحَمَّدُ بْنُ رُمْحٍ، أَخْبَرَنَا اللَّيْثُ، عَنْ أَبِي الزُّبَيْرِ، عَنْ جَابِرٍ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَالَ ‏"‏ غَطُّوا الإِنَاءَ وَأَوْكُوا السِّقَاءَ وَأَغْلِقُوا الْبَابَ وَأَطْفِئُوا السِّرَاجَ فَإِنَّ الشَّيْطَانَ لاَ يَحُلُّ سِقَاءً وَلاَ يَفْتَحُ بَابًا وَلاَ يَكْشِفُ إِنَاءً فَإِنْ لَمْ يَجِدْ أَحَدُكُمْ إِلاَّ أَنْ يَعْرُضَ عَلَى إِنَائِهِ عُودًا وَيَذْكُرَ اسْمَ اللَّهِ فَلْيَفْعَلْ فَإِنَّ الْفُوَيْسِقَةَ تُضْرِمُ عَلَى أَهْلِ الْبَيْتِ بَيْتَهُمْ ‏"‏ ‏.‏ وَلَمْ يَذْكُرْ قُتَيْبَةُ فِي حَدِيثِهِ ‏"‏ وَأَغْلِقُوا الْبَابَ ‏"‏ ‏.‏
Reference : Sahih Muslim 2012a
In-book reference : Book 36, Hadith 120
USC-MSA web (English) reference : Book 23, Hadith 4991
  (deprecated numbering scheme)