Hadithcore
Mishkat al-Masabih, 3701

Ibn ‘Abbas reported the Prophet (ﷺ) as saying, “He who lives in the desert will become rough, he who follows the chase will become negligent, and he who goes to a ruler will be led astray.” Ahmad, Tirmidhi and Nasa’i transmitted it. Abu Dawud’s version has, “He who attaches himself to a ruler will be led astray, and the nearer a man comes to a ruler the farther he goes from God.”

وَعَنِ ابْنِ عَبَّاسٍ عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ: «مَنْ سَكَنَ الْبَادِيَةَ جَفَا وَمَنِ اتَّبَعَ الصَّيْدَ غَفَلَ وَمَنْ أَتَى السُّلْطَانَ افْتُتِنَ» . رَوَاهُ أَحْمَدُ وَالتِّرْمِذِيُّ وَالنَّسَائِيُّ وَفِي رِوَايَةِ أَبِي دَاوُدَ: «مَنْ لَزِمَ السُّلْطَانَ افْتُتِنَ وَمَا ازْدَادَ عَبْدٌ مِنَ السُّلْطَانِ دُنُوًّا إِلَّا ازْدَادَ من اللَّهِ بُعداً»

References1 variant
In-Book Reference
Book 18, Hadith 41