A very good question indeed! First let me say you can find some good point about ruling in Islam here and here, in shaa' Allah.
But to answer your question I found the following Ahadeeth from the Sunni books to which I had access:
Narrated Abdullah: Allah's Apostle said to us, "You will see after me,
selfishness (on the part of other people) and other matters that you
will disapprove of." They asked, "What do you order us to do, O
Allah's Apostle? (under such circumstances)?" He said, "Pay their
rights to them (to the rulers) and ask your right from Allah."
[Bukari, Book 88, Hadith 175]
Narrated by ibn Abbas: the prophet said, "whoever disapproves of
something done by his ruler then he should be patient, for whoever
disobeys the ruler even a little (little = a span) will die as those
who died in the pre-lslamic period of ignorance. (i.e. as rebellious
sinners). [Bukari, Book 88, Hadith 176]
quoted from ibn Umar: The 'Prophet said, "It is obligatory for one to
listen to and obey (the ruler's orders) unless these orders involve
one disobedience (to Allah); but if an act of disobedience (to Allah)
is imposed, he should not listen to or obey it." [Bukhari, Volume 4,
Book 52, Number 203]
It has been narrated on the authority of Ibn 'Umar that the Holy
Prophet (may peace be upon him) said: It is obligatory upon a Muslim
that he should listen (to the ruler appointed over him) and obey him
whether he likes it or not, except that he is ordered to do a sinful
thing. If he is ordered to do a sinful act, a Muslim should neither.
listen to him nor should he obey his orders. [Muslim, Book 020, Hadith
4533]
It has been narrated on the authority of Alqama b. Wai'l al-Hadrami
who learnt the tradition from his father. The latter said: Salama b.
Yazid al-ju'afi asked the Messenger of Allah (may peace be upon him):
Prophet of Allah, what do you think if we have rulers who rule over us
and demand that we discharge our obligations towards them, but they
(themselves) do not discharge their own responsibilities towards us?
What do you order us to do? The Messenger of Allah (may peace be upon
him) avoided giving any answer. Salama asked him again. He (again)
avoided giving any answer. Then he asked again-it was the second time
or the third time-when Ash'ath b. Qais (finding that the Holy Prophet
was unnecessarily being pressed for answer) pulled him aside and said:
Listen to them and obey them, for on them shall he their burden and on
you shall be your burden. [Muslim, Book 020, Hadith 4551]
It has been narrated on the authority of 'Auf b. Malik that the
Messenger of Allah (may peace be upon him) said: The best of your
rulers are those whom you love and who love you, who invoke God's
blessings upon you and you invoke His blessings upon them. And the
worst of your rulers are those whom you hate and who hate you and whom
you curse and who curse you. It was asked (by those present):
Shouldn't we overthrow them with the help of the sword? He said: No,
as long as they establish prayer among you. If you then find anything
detestable in them. You should hate their administration, but do not
withdraw yourselves from their obedience. [Muslim, Book 020, Hadith
4573]
Narrated by Junada bin Abi Umaiya: We entered upon 'Ubada bin As-Samit
while he was sick. We said, "May Allah make you healthy. Will you tell
us a Hadith you heard from the Prophet and by which Allah may make you
benefit?" He said, "The Prophet called us and we gave him the Pledge
of allegiance for Islam, and among the conditions on which he took the
Pledge from us, was that we were to listen and obey (the orders) both
at the time when we were active and at the time when we were tired,
and at our difficult time and at our ease and to be obedient to the
ruler and give him his right even if he did not give us our right, and
not to fight against him unless we noticed him having open Kufr
(disbelief) for which we would have a proof with us from Allah."
[Bukari, Book 88, Hadith 178]
Narrated Usaid bin Hudair: A man came to the Prophet and said, "O
Allah's Apostle! You appointed such-and-such person and you did not
appoint me?" The Prophet said, "After me you will see rulers not
giving you your right (but you should give them their right) and be
patient till you meet me." [Bukari, Book 88, Hadith 179]
In short they say a ruler might be good or bad, just or unjust, wrongdoer or pious. If he was not a good ruler he will be punished for that by Allah and no one is allowed to raise against him during this life, obeying them is thus obligatory. Indeed, these Ahadeeth are introducing the position of a ruler among the Muslims somewhat like the position Allah has introduced for parents among their children, that obey and please them and only if they tried to force you to do something which is a sin then avoid obeying them such. The notion of the prophet --peace be upon him and his family-- himself being like a father for all Muslims is not any strange, moreover that he never orders any sin to be done! However, can this be accepted also about unjust cruel ruler as well? I researched around some of the Fatwa's from Sunni scholars as well, e.g. in the book Al-muqhani (المغنی) written by Ibn Qidamih Hanbali (ابن قدامه حنبلی) page 52 he says: "if someone raised against a ruler [which is Haraam on its own according to such Ahadeeth] and won and killed the previous ruler and forced the people by the power of sword to obey him and they accepted him, then he is the new ruler of the society and war against him is forbidden, as historically Abdul Malik Marwan fighted against Abdullah ibn Zubair and killed him and conquered his land and people until the people on their will or on force gave a pledge of allegiance to him and so became he the new ruler against whom raising was forbidden", see this link in Persian for more details and similar Fatwa's.
However, Ayasha and Mu'aviyyah ibn AbuSufyan were probably the first ones who raised in front of a Caliph, Imam Ali --peace be upon him-- while he wan not an Unjust Caliph at all!
Of course Shia Muslims do not approve any of the above quoted Ahadeeth! If the rulers are chosen from Allah and His apostle --peace be upon him and his household-- we would assume fighting against them as forbidden, but they will not be wrong as they are patterns of Islam and should be infallible for us to have reasonable justification for us to submit to them. See how Qur'aan addresses this issue:
... لَا تَظْلِمُونَ وَلَا تُظْلَمُونَ
... Deal not unjustly, and ye shall not be dealt with unjustly [2:279]
accepting to undergo oppression (انظلام) is not approved in religion, and prophet --peace be upon him and his family-- never accept such to remain silent in front of oppression, unless there was a wisdom before his temporal decision. Recall e.g. what is famous as League of the Virtuous (حلف الفضول). This not accepting to be oppressed can be understood also from the following verse that somewhat says if you can not change the situation at least leave the place:
إِنَّ الَّذِينَ تَوَفَّاهُمُ الْمَلَائِكَةُ ظَالِمِي أَنفُسِهِمْ
قَالُوا فِيمَ كُنتُمْ ۖ قَالُوا كُنَّا مُسْتَضْعَفِينَ فِي الْأَرْضِ ۚ
قَالُوا أَلَمْ تَكُنْ أَرْضُ اللَّـهِ وَاسِعَةً فَتُهَاجِرُوا فِيهَا ۚ
فَأُولَـٰئِكَ مَأْوَاهُمْ جَهَنَّمُ ۖ وَسَاءَتْ مَصِيرًا
When angels take the souls of those who die in sin against their
souls, they say: "In what (plight) Were ye?" They reply: "Weak and
oppressed Were we in the earth." They say: "Was not the earth of Allah
spacious enough for you to move yourselves away (From evil)?" Such men
will find their abode in Hell,- What an evil refuge! [4:97]
وَالَّذِينَ هَاجَرُوا فِي اللَّـهِ مِن بَعْدِ مَا ظُلِمُوا
لَنُبَوِّئَنَّهُمْ فِي الدُّنْيَا حَسَنَةً ۖ وَلَأَجْرُ الْآخِرَةِ
أَكْبَرُ ۚ لَوْ كَانُوا يَعْلَمُونَ
To those who leave their homes in the cause of Allah, after suffering
oppression,- We will assuredly give a goodly home in this world; but
truly the reward of the Hereafter will be greater. If they only
realized (this)! [16:41]
and this was exactly what the holy prophet --peace be upon him and his household-- did and when they obtained enough power and force returned to Mecca and concurred it and rescued it from oppression of Shirk and its subsequent.
also see the following verses that never encourage anyone to bear oppression:
... وَمَا اللَّـهُ يُرِيدُ ظُلْمًا لِّلْعِبَادِ
... Allah never wishes injustice to his Servants. [40:31]
... قُلْ إِنَّ اللَّـهَ لَا يَأْمُرُ بِالْفَحْشَاءِ ۖ أَتَقُولُونَ
عَلَى اللَّـهِ مَا لَا تَعْلَمُونَ
... Say: "Nay, Allah never commands what is shameful: do ye say of
Allah what ye know not?" [7:28]
إِنَّ اللَّـهَ يَأْمُرُ بِالْعَدْلِ وَالْإِحْسَانِ وَإِيتَاءِ ذِي
الْقُرْبَىٰ وَيَنْهَىٰ عَنِ الْفَحْشَاءِ وَالْمُنكَرِ وَالْبَغْيِ ۚ
يَعِظُكُمْ لَعَلَّكُمْ تَذَكَّرُونَ
Allah commands justice, the doing of good, and liberality to kith and
kin, and He forbids all shameful deeds, and injustice and rebellion:
He instructs you, that ye may receive admonition. [16:90]
يَا أَيُّهَا الَّذِينَ آمَنُوا كُونُوا قَوَّامِينَ بِالْقِسْطِ ...
O ye who believe! stand out firmly for justice ...
الَّذِينَ أُخْرِجُوا مِن دِيَارِهِم بِغَيْرِ حَقٍّ إِلَّا أَن
يَقُولُوا رَبُّنَا اللَّـهُ ۗ وَلَوْلَا دَفْعُ اللَّـهِ النَّاسَ
بَعْضَهُم بِبَعْضٍ لَّهُدِّمَتْ صَوَامِعُ وَبِيَعٌ وَصَلَوَاتٌ
وَمَسَاجِدُ يُذْكَرُ فِيهَا اسْمُ اللَّـهِ كَثِيرًا ۗ وَلَيَنصُرَنَّ
اللَّـهُ مَن يَنصُرُهُ ۗ إِنَّ اللَّـهَ لَقَوِيٌّ عَزِيزٌ / الَّذِينَ
إِن مَّكَّنَّاهُمْ فِي الْأَرْضِ أَقَامُوا الصَّلَاةَ وَآتَوُا
الزَّكَاةَ وَأَمَرُوا بِالْمَعْرُوفِ وَنَهَوْا عَنِ الْمُنكَرِ ۗ
وَلِلَّـهِ عَاقِبَةُ الْأُمُورِ
(They are) those who have been expelled from their homes in defiance
of right,- (for no cause) except that they say, "our Lord is Allah".
Did not Allah check one set of people by means of another, there would
surely have been pulled down monasteries, churches, synagogues, and
mosques, in which the name of Allah is commemorated in abundant
measure. Allah will certainly aid those who aid his (cause);- for
verily Allah is full of Strength, Exalted in Might, (able to enforce
His Will). / (They are) those who, if We establish them in the land,
establish regular prayer and give regular charity, enjoin the right
and forbid wrong: with Allah rests the end (and decision) of (all)
affairs. [22:40,41]
وَلْتَكُن مِّنكُمْ أُمَّةٌ يَدْعُونَ إِلَى الْخَيْرِ وَيَأْمُرُونَ
بِالْمَعْرُوفِ وَيَنْهَوْنَ عَنِ الْمُنكَرِ ۚ وَأُولَـٰئِكَ هُمُ
الْمُفْلِحُونَ
Let there arise out of you a band of people inviting to all that is
good, enjoining what is right, and forbidding what is wrong: They are
the ones to attain felicity. [3:104]
... وَأْمُرْ بِالْمَعْرُوفِ وَانْهَ عَنِ الْمُنكَرِ وَاصْبِرْ عَلَىٰ
مَا أَصَابَكَ ۖ إِنَّ ذَٰلِكَ مِنْ عَزْمِ الْأُمُورِ
enjoin what is just, and forbid what is wrong: and bear with patient
constancy whatever betide thee; for this is firmness (of purpose) in
(the conduct of) affairs. [31:17]
... وَلَوْلَا دَفْعُ اللَّـهِ النَّاسَ بَعْضَهُم بِبَعْضٍ لَّفَسَدَتِ
الْأَرْضُ وَلَـٰكِنَّ اللَّـهَ ذُو فَضْلٍ عَلَى الْعَالَمِينَ
... And did not Allah Check one set of people by means of another, the
earth would indeed be full of mischief: But Allah is full of bounty to
all the worlds. [2:251]
وَمِنْهُمْ أُمِّيُّونَ لَا يَعْلَمُونَ الْكِتَابَ إِلَّا أَمَانِيَّ
وَإِنْ هُمْ إِلَّا يَظُنُّونَ
And there are among them illiterates, who know not the Book, but (see
therein their own) desires, and they do nothing but conjecture. [2:78]
وَلَوِ اتَّبَعَ الْحَقُّ أَهْوَاءَهُمْ لَفَسَدَتِ السَّمَاوَاتُ
وَالْأَرْضُ وَمَن فِيهِنَّ ۚ بَلْ أَتَيْنَاهُم بِذِكْرِهِمْ فَهُمْ عَن
ذِكْرِهِم مُّعْرِضُونَ
If the Truth had been in accord with their desires, truly the heavens
and the earth, and all beings therein would have been in confusion and
corruption! Nay, We have sent them their admonition, but they turn
away from their admonition. [23:71]
To say in short, Allah never lets oppression to be born, both those who spread oppression and those who bear it in silence and sorrow would be questioned and if found guilty will be punished, the former due to their injustice and the latter for their not being submitted to Allah and refusing to enjoin what is good and forbid what is wrong. Now do you know any "enjoining what is Just and forbidding what is wrong" better and more effective than rebelling against the wrong ruler? It was based on this Qur'aanic and Islamic concept that Imam Hussain --peace be upon him-- avoided to give a pledge of allegiance to Yazid ibn Mu3aawiyyah, went to Karbala and was killed together with his companions and family members for Islam to remain alive. Indeed, Shia Muslims believe in the following Ahadeeth:
Ibn Mas3ud quoted from the holy prophet --peace be upon him-- that he
said "... ستكون عليكم ائمة ان اطعتموهم اضلوكم و ان عصيتموهم قتلوكم"
(will come to you Imams who will misguide you if you obey them and
will kill you if disobey them). They said: "فكيف نصنع يا رسول الله؟"
(so what should we do then O apostle of Allah?), he answered: "کونوا
كاصحاب عيسى نصبوا على الخشب و نشروا بالمناشير؛ موت فى طاعة خير من حياة
فى معصية" (be like the apostles of Jesus who were crossed on woods and
were teared with saws, death in the submission to Allah is better that
living in His disobedience)! [نهج البلاغه، خطبه 173]
افضل الجهاد كلمة عدل عند امام جائر
The best Jihaad is telling a word of justice in near to an oppressing
Imam. [نهجالسعادة، ج 2، ص 639]
you can find many more discussion about this important issue in almost any Shia book that considers this problem. See this link in Persian as well.
Last but by no means least, the uprisings around the globe against oppression being in Arab countries or in Western countries all go well with the Shia view of Jihaad according to Qur'aan and Hadeeth, and Iran withstanding all the sanctions and wars against it is also rotted in the same believes. Accountability of the rulers in Islam is well recognized as long as they are not infallible in the sense that the holy prophet and his Ahlul Bayt were, peace be upon them all.