Its chain of transmission is authentic according to Muslim’s criteria.
2232 — “Is service in the cause of Allah restricted to one who is killed? Whoever strives to provide for his parents is in the cause of Allah; whoever strives to provide for his dependents is in the cause of Allah; whoever strives for himself in order to keep himself from need is in the cause of Allah; and whoever strives merely to accumulate more is in the cause of falsehood.” In another version: “the path of Satan.”
Al-Bazzar narrated it (1871—al-Kashf), as did Abu Nuʿaym in al-Hilyah (6/196–197), al-Asbahani in al-Targhib wa al-Tarhib (fols. 47/2–48/1; Islamic University photocopy no. 2), and al-Bayhaqi in al-Sunan (9/25), through routes from Ahmad ibn ʿAbdullah ibn Yunus: Riyah ibn ʿAmr narrated to us from Ayyub al-Sakhtiyani, from Muhammad ibn Sirin, from Abu Hurayrah, who said:
While we were with the Messenger of Allah, peace and blessings be upon him, a young man appeared from the mountain pass. When we saw him, we fixed our eyes on him and said, “If only this young man would devote his youth, vigor, and strength to the cause of Allah!” The Messenger of Allah, peace and blessings be upon him, heard what we said and replied with the words cited above.
The wording is that of Abu Nuʿaym, and the additional wording is from al-Asbahani.
I say: Its chain of transmission is good. Its narrators are reliable narrators of the two Sahihs, apart from Riyah ibn ʿAmr—al-Qaysi—who is truthful, as Abu Zurʿah stated. In al-Majmaʿ (8/144), he said: “Al-Bazzar and al-Tabarani in al-Awsat narrated it. Its chain includes Ribah ibn ʿUmar, whom Abu Hatim declared trustworthy, though others deemed him weak; the rest of its narrators are narrators of the Sahih.” This is how it appears there: “Ribah,” with b; but the correct form is Riyah, with y, and Ibn ʿUmar