Question : A Muslim sister asks about the ruling on turning one’s head during Salah to seek refuge in Allah from the devil called Khanzab (a devil that distracts a servant at the time of prayer)?
A: There is no harm in turning the head during Salah seeking refuge in Allah from the accursed Satan when casting his insinuations. Rather, it is desirable when there is a dire need for it on condition that it is done by moving one’s head only, because the Prophet (peace be upon him) ordered ‘Uthman ibn Abul-‘As Ath-Thaqafi (may Allah be pleased with him) to do so when he complained to the Prophet about the insinuating thoughts that Satan casts during prayers, so he ordered him to spit (dryly) to his left side three times and seek refuge in Allah from Satan. He did so and Allah granted him recovery.
As for turning one’s head during performing Salah without a due reason, this is undesirable. When the Prophet (peace be upon him) was asked about this, he said: It is a quick stealing by which Satan takes away (a portion) from the prayer of a person (By making him glance left and right). May Allah guide us all to what pleases Him! He is All-Hearing and Responsive.
 Related by Muslim, Book on greetings, Chapter on seeking refuge from the insinuating thoughts of Satan during Salah, no. 4083
General Chairman of the Departments of Scholarly Research, Ifta’, Da`wah, and Guidance
Fatwas of Ibn Baz
Related Link: https://abdurrahman.org/jinn-shayateen-devils