It was in a hermitage on top of Jabal al-'Alam, near Tétouan, that he met the sheikh who he was searching for and who was to have the greatest influence on his life, Abd as-Salam ibn Mashish (d. 625/1228), known as "the Pole of the West", just as Abd al-Qadir Gilani (d. 561/1166) was called "the Pole of the East". While he was living with Sheikh Ibn Mashish, on the holy mountain, many wonderful signs from Allah came to Abu'l Hasan, through this holy guide. One such sign was that on the night of his arrival on the mountain he was sleeping at the entrance of the cave where his master lived. He dreamt that he was asking the Sheikh to grant him certain wishes, one of them being that Allah would incline the hearts of His creatures in favour towards him. Then he wished to ask his master if it was necessary for him to live in solitude, or in the desert, in order for him to be in the right station (maqaam) to perform his religious tasks, or whether he should return to the towns and inhabited places to seek out the company of scholars and virtuous people. While he was turning these things in his heart he heard the Sheikh praying fervently and calling out: