He said, I heard the Messenger of Allah ﷺ say, "Standing guard at the frontier for a day and a night is better than fasting a month and praying through its nights. If a man dies while doing so, the deeds he used to perform continue to be credited to him, his provision continues to flow, and he is kept safe from the trial of the grave."
قال سمعت رسول الله ﷺ يقول: رباط يوم وليلة خير من صيام شهر وقيامه، وإن مات جرى عليه عمله الذي كان يعمله، وأجرى عليه رزقه، وأمن الفتان.
Muslim narrated it in the Book of Leadership (1913:163) from Abdullah bin Abdul-Rahman Darimi, who said, Abu Walid Tayalisi narrated to us, who said, Layth bin Saad narrated to us, from Ayub bin Musa, from Makhul, from Shurahbil bin Simt, from Salman, who said, then he mentioned it.Salman is Farsi, the well-known companion, also called Salman al-Khayr.His statement, "his deeds continued to run for him," means that his deeds keep increasing, as stated explicitly in Sunan Abu Dawud (2500) and Tirmidhi (1621), with the wording, "Every dead person's deeds are sealed off, except one who died while stationed on guard duty in the cause of Allah, for his deeds continue to increase for him until the Day of Resurrection, and he is protected from the trial of the grave." The wording given is Tirmidhi's, and he said it is hasan sahih.I say, it is hasan on account of Abu Hani, who is acceptable, and he is among the narrators relied upon by Muslim.