Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:12371[Chain 1] Abū ʿAbdullāh al-Ḥāfiẓ > Abū ʿAbdullāh Muḥammad b. ʿAbdullāh b. Dīnār al-ʿAdl And ʾAbū al-Faḍl al-Ḥasan b. Yaʿqūb > al-Sarī b. Khuzaymah > Mūsá b. Ismāʿīl > Wuhayb [Chain 2] Abū ʿAbdullāh > Abū al-Naḍr al-Faqīh > al-Ḥasan b. Sufyān > ʿAbd al-Aʿlá b. Ḥammād And ʾIbrāhīm b. al-Ḥajjāj > Wuhayb > Ibn Ṭāwus from his father > Ibn ʿAbbās

[Machine] That the Prophet ﷺ said, "Combine wealth with the obligations, and whatever remains of the obligations should go to the nearest male heirs." And in another narration of Musa: "Combine the obligations with their rightful recipients, and whatever is left should go to the nearest male heirs."  

البيهقي:١٢٣٧١أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ أنا أَبُو عَبْدِ اللهِ مُحَمَّدُ بْنُ عَبْدِ اللهِ بْنِ دِينَارٍ الْعَدْلُ وَأَبُو الْفَضْلِ الْحَسَنُ بْنُ يَعْقُوبَ قَالَا ثنا السَّرِيُّ بْنُ خُزَيْمَةَ ثنا مُوسَى بْنُ إِسْمَاعِيلَ ثنا وُهَيْبٌ ح وَأَخْبَرَنَا أَبُو عَبْدِ اللهِ أَخْبَرَنِي أَبُو النَّضْرِ الْفَقِيهُ ثنا الْحَسَنُ بْنُ سُفْيَانَ ثنا عَبْدُ الْأَعْلَى بْنُ حَمَّادٍ وَإِبْرَاهِيمُ بْنُ الْحَجَّاجِ قَالَا ثنا وُهَيْبٌ عَنِ ابْنِ طَاوُسٍ عَنْ أَبِيهِ عَنِ ابْنِ عَبَّاسٍ

أَنَّ النَّبِيَّ ﷺ قَالَ أَلْحِقُوا الْمَالَ بِالْفَرَائِضِ فَمَا أَبْقَتِ الْفَرَائِضُ فَلِأَوْلَى رَجُلٍ ذَكَرٍ وَفِي رِوَايَةِ مُوسَى أَلْحِقُوا الْفَرَائِضَ بِأَهْلِهَا فَمَا بَقِيَ فَهُوَ لِأَوْلَى رَجُلٍ ذَكَرٍ  

رَوَاهُ الْبُخَارِيُّ فِي الصَّحِيحِ عَنْ مُوسَى بْنِ إِسْمَاعِيلَ وَرَوَاهُ مُسْلِمٌ عَنْ عَبْدِ الْأَعْلَى بْنِ حَمَّادٍ

See similar narrations below:

Collected by Bayhaqī
bayhaqi:12336[Chain 1] Abū al-Ḥasan ʿAlī b. Aḥmad b. ʿAbdān > Aḥmad b. ʿUbayd > Ismāʿīl b. Isḥāq > Sulaymān b. Ḥarb > Wuhayb b. Khālid [Chain 2] Abū ʿAbdullāh al-Ḥāfiẓ > Abū al-Ḥasan Aḥmad b. Muḥammad al-ʿAnazī > ʿUthmān b. Saʿīd al-Dārimī > Mūsá b. Ismāʿīl > Wuhayb > ʿAbdullāh b. Ṭāwus from his father > Ibn ʿAbbās

[Machine] The Messenger of Allah ﷺ said, "Give the obligatory rights to their rightful owners. Whatever is left belongs to the nearest relative."  

البيهقي:١٢٣٣٦أَخْبَرَنَا أَبُو الْحَسَنِ عَلِيُّ بْنُ أَحْمَدَ بْنِ عَبْدَانَ أنا أَحْمَدُ بْنُ عُبَيْدٍ ثنا إِسْمَاعِيلُ بْنُ إِسْحَاقَ ثنا سُلَيْمَانُ بْنُ حَرْبٍ ثنا وُهَيْبُ بْنُ خَالِدٍ ح وَأنا أَبُو عَبْدِ اللهِ الْحَافِظُ أنا أَبُو الْحَسَنِ أَحْمَدُ بْنُ مُحَمَّدٍ الْعَنَزِيُّ ثنا عُثْمَانُ بْنُ سَعِيدٍ الدَّارِمِيُّ ثنا مُوسَى بْنُ إِسْمَاعِيلَ ثنا وُهَيْبٌ ثنا عَبْدُ اللهِ بْنُ طَاوُسٍ عَنْ أَبِيهِ عَنِ ابْنِ عَبَّاسٍ قَالَ

قَالَ رَسُولُ اللهِ ﷺ أَلْحِقُوا الْفَرَائِضَ بِأَهْلِهَا فَمَا بَقِيَ فَهُوَ لِأَوْلَى رَجُلٍ ذَكَرٍ  

رَوَاهُ الْبُخَارِيُّ فِي الصَّحِيحِ عَنْ سُلَيْمَانَ بْنِ حَرْبٍ وَمُوسَى بْنِ إِسْمَاعِيلَ وَرَوَاهُ مُسْلِمٌ عَنْ عَبْدِ الْأَعْلَى بْنِ حَمَّادٍ عَنْ وُهَيْبٍ