The Prophet ﷺ said: Stand close together in your rows, bring them near one another, and stand neck to neck, for by Him in Whose hand my soul is, I see the devil coming in through openings in the row just like a small black sheep. (Using translation from Abū Dāʾūd 667)
وَأَنَّ النَّبِيَّ ﷺ كَانَ يَقُولُ رَاصُّوا صُفُوفَكُمْ وَقَارِبُوا بَيْنَهَا وَحَاذُوا بَيْنَ الْأَعْنَاقِ فَوَالَّذِي نَفْسُ مُحَمَّدٍ بِيَدِهِ إِنِّي لَأَرَى الشَّيْطَانَ يَدْخُلُ مِنْ خَلَلِ الصَّفِّ كَأَنَّهُ الْحَذَفُ