Sunan Abu Dawood 2977
A similar tradition has been narrated by Ibn Shihab through a different chain of narrators. This version says:
I said: Do you not fear Allah ? Did you not hear the Messenger of Allah ﷺ say: We are not inherited. Whatever we leave is sadaqah (alms). This property belongs to the family of Muhammad for their emergent needs and their guest. When I die, it will go to him who becomes ruler after me.
حَدَّثَنَا مُحَمَّدُ بْنُ يَحْيَى بْنِ فَارِسٍ، حَدَّثَنَا إِبْرَاهِيمُ بْنُ حَمْزَةَ، حَدَّثَنَا حَاتِمُ بْنُ إِسْمَاعِيلَ، عَنْ أُسَامَةَ بْنِ زَيْدٍ، عَنِ ابْنِ شِهَابٍ، بِإِسْنَادِهِ نَحْوَهُ قُلْتُ أَلاَ تَتَّقِينَ اللَّهَ أَلَمْ تَسْمَعْنَ رَسُولَ اللَّهِ ﷺ يَقُولُ " لاَ نُورَثُ مَا تَرَكْنَا فَهُوَ صَدَقَةٌ وَإِنَّمَا هَذَا الْمَالُ لآلِ مُحَمَّدٍ لِنَائِبَتِهِمْ وَلِضَيْفِهِمْ فَإِذَا مِتُّ فَهُوَ إِلَى مَنْ وَلِيَ الأَمْرَ مِنْ بَعْدِي " .