Abu Saeed Khudri reported,

The Messenger of Allah ﷺ said, "When one of you prays, let him pray toward a barrier and stay close to it, and let him not allow anyone to pass in front of him. If someone tries to pass, let him fight him off, for he is a devil."

Ibn Majah 954

Sahih

حدثنا أبو كريب حدثنا أبو خالد الأحمر عن ابن عجلان عن زيد بن أسلم

عن عبد الرحمن بن أبي سعيد عن أبيه قال

قال رسول الله ﷺ إذا صلى أحدكم فليصل إلى سترة وليدن منها ولا يدع أحدا يمر بين يديه فإن جاء أحد يمر فليقاتله فإنه شيطان

ابن ماجه 954صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Establishing prayer and the sunnah regarding it
Chapter
Ward off what you are able to
Numbering
Darussalam 954
Ibn Majah 954