(Four deeds of the living continue to benefit the dead: A man who leaves behind righteous offspring who supplicate for him, and their supplication reaches him. A man who gives ongoing charity, for which he receives reward as long as it continues. A man who imparts knowledge that is acted upon after him, for which he receives a reward equivalent to that of those who act upon it, without diminishing their reward in any way. And a man who guards the frontier, whose deeds are increased until the Day of Judgment). Narrated by Ibn Abī al-Dunyā in the book "al-ʿIyāl" (2/613-431) - and the context is his - and al-Ṭabarānī in "al-Muʿjam al-Kabīr" (6/328/6181) through the route of Isḥāq ibn ʿAbd Allāh from Makhūl from Sharḥabīl ibn al-Ṣimṭ from Salmān who said: I heard the Messenger of Allāh (ṣallá Allāhu ʿalayhi wa-sallam) say: ... and he mentioned it. Then Ibn Abī al-Dunyā narrated it under number (432) with the same isnād from Isḥāq ibn ʿAbd Allāh from Abān ibn Ṣāliḥ from ʿĀmir ibn Saʿd from ʿAbd Allāh ibn Masʿūd from the Prophet (ṣallá Allāhu ʿalayhi wa-sallam) ... similarly. I say: Its narrators are trustworthy; except for Isḥāq ibn ʿAbd Allāh - who is Ibn Abī Furwah - and he is weak and abandoned. However, the ḥadīth is ḥasan due to other supporting narrations; because it appears in several ḥadīths, the most authentic and famous of which is: "When a person dies, his deeds cease except for three ... " the ḥadīth. Narrated by Muslim and others
(أربعٌ من عَمَلِ الأَحياءِ يجرِي للأمواتِ: رجلٌ ترك عَقِباً صالحاً فيدعو، فيبلغه دعاؤهم. ورجل تصدق بصدقة جارية، له من بعده أجرها ما جَرَت. ورجل علَّم علماً يُُعمَلُ به من بعده، فله مثل أجر من عمل به؛ من غير أن ينتقص من [أجر] عمله شيئاً. ورجل مرابط يُنمَى له عمله إلى يوم الحساب). أخرجه ابن أبي الدنيا في كتاب "العيال" (٢/٦١٣-٤٣١) - والسياق له-، والطبراني في "المعجم الكبير" (٦/٣٢٨/٦١٨١) من طريق إسحاق بن عبد الله عن مكحول عن شرحبيل بن السمط عن سلمان قال: سمعت رسول الله ﷺ قال: ... فذ كره. ثم رواه ابن أبي الدنيا رقم (٤٣٢) بالإسناد نفسه عن إسحاق بن عبد الله عن أبان بن صالح عن عامر بن سعد عن عبد الله بن مسعود عن النبي- ﷺ ... مثله. قلت: ورجاله ثقات؛ غير إسحاق بن عبد الله- وهو ابن أبي فروة-؛ وهو ضعيف متروك. لكن الحديث حسن لغيره؛ لأنه جاء مفرقاً في جملة أحاديث، أصحها وأشهرها: "إذا مات الإنسان؛ انقطع عمله إلا من ثلاث ... " الحديث. رواه مسلم وغيره.