Abu Huraira reported Allah's Messenger (ﷺ) as saying
It is better that one of you should sit on live coals which would burn his clothing and come in contact with his skin than that he should sit on a grave.
A hadith like this has been narrated by Suhail with the same chain of transmitters.
Abu Marthad al-Ghanawi reported Allah's Messenger (ﷺ) as saying
Do not sit on the graves and do not pray facing towards them.
Abu Marthad al-Ghanawi reported Allah's Messenger (ﷺ) as saying
Do not pray facing towards the graves, and do not sit on them.