Abu Sa‘eed Abdur Rahman bin Samurah (may Allah be pleased with him) relates that the Holy Messenger (peace and blessings of Allah be to him) said to him, “O Abdur Rahman bin Samurah! Do not ask for public office or authority. Because if you are given an office without asking for it, you will be helped in this matter. But if you are assigned for it on your asking for it, you will be in its possession. If you take oath to do a thing and later on find a better substitute, adopt the latter and make amends for your vow.”
(Bukhari, Muslim)
Muslims have been enjoined not to yearn for public office and authority. If a person is given a post of authority, he should take it up with the name of Allah. In this case, people will be obliged to help him in all the relevant matters. And God will also help him in discharging the duties.
On the contrary, if a person seeks a post of authority on his own and canvass for and ultimately succeeds in getting a post, people will not be obliged to come to his succour and he will be left alone. And he will not be able to fulfil his duties.
In another hadith, the Holy Messenger (peace and blessings of Allah be to him) said, “Time is coming when you will aspire for public offices and authority, but beware, it will be a matter of humiliation and repentance on the Day of Judgement.”