Working in banks that deal with riba is haraam, because of the hadeeth of Jaabir (may Allaah be pleased with him) who said: The Messenger of Allaah (peace and blessings of Allaah be upon him) cursed the one who consumes riba and the one who pays it, the one who writes it down and the two who witness it, and he said: they are all the same. Narrated by Muslim (2995).
Al-Nawawi (may Allaah have mercy on him) said:
This clearly shows that it is haraam to write down the contract between two who are engaging in riba, and to bear witness to it, and that it is haraam to assist in falsehood. End quote.
The one who works in a riba-based bank will inevitably be involved in one of these scenarios that were mentioned by al-Nawawi; he will either write down or record riba, or witness it, or help those who are dealing in riba in their falsehood.
You have to fear Allaah and look for permissible work; Allaah will never forsake you if you fear Him and put your trust in Him. Allaah says (interpretation of the meaning):
“And whosoever fears Allaah and keeps his duty to Him, He will make a way for him to get out (from every difficulty).
3. And He will provide him from (sources) he never could imagine”
If you are faced with hardship, then be patient, and be certain that relief will come, for hardship is followed by relief, as Allaah says (interpretation of the meaning):
“Verily, along with every hardship is relief,
6. Verily, along with every hardship is relief”
But if you reach a state of necessity and you fear that you may die if you do not consume something haraam, in this case Allaah has permitted you to consume enough haraam to ward off harm from yourself. Allaah says (interpretation of the meaning):
“He has explained to you in detail what is forbidden to you, except under compulsion of necessity”
This situation is in fact unlikely to arise, because you will never be without permissible work from which you can earn enough to cover the necessities. We ask Allaah to grant you sufficient by means of that which He has permitted so that you will have no need of that which He has forbidden.
And Allaah knows best.