Haram Jobs in Islam
Question

I have completed my Masters Degree in Human Resource Management (HRM) / Personnel Management, which is a specialised branch of MBA. However, now that Allah has guided me to practice Islam I find this qualification a waste, because 1. The jobs that are available based on this qualification invariably entail writing down riba (i.e. helping employees get provident fund, insurance, bank loans etc, keeping records of the riba involved etc) 2. Almost all Human Resource jobs also entail recruiting people – both men and women, and for this it means being alone with a non mahram woman during the interview and even afterwards, for performance appraisals etc, asking about their personal and professional lives. 3. In any case all workplaces with HR departments (without a single exception in my land) are mixed where women make wanton display of their beauty.
Should I take up any of such job, hoping to conduct myself in a good Islamic manner and thereby attract my colleagues to Islam, or should I shun such jobs and study some other skills, the resultant occupation, though lesser in terms of salary or status, may not lead to such evils. 
If so, kindly suggest some occupations where such evils can be minimized. Also, please give examples of how the Sahabah and the salaf earned their livelihood. 
Also, some people say Prophet Mohammed, may Allah bless him and grant him peace, preferred business over a job. Is there any basis in this saying?
Please give me a speedy answer because I have now completed my studies and am on the lookout for a job. May Allah reward you for your efforts to find solutions based on the Quran and Sunnah.
Praise be to Allah.Haram jobs
Some jobs are haram in and of themselves, such as working in riba-based banks and places where alcohol is sold . Some may be haram because of things in the work-place that are contrary to Shari`ah, such as mixing between men and women , or because it is stipulated that one should wear haram clothing or do other things that are contrary to Shari`ah, such as shaving the beard . It is not permissible for the Muslim to do either type of job.
Jobs of the second type vary in the degree to which they are haram. The one which incurs the greatest burden of sin is that which involves writing down or recording riba (usury), then that which involves selling or manufacturing haram things , then that in which the workplace environment is haram. 
The last category should not be taken lightly, because it has an impact on the religious commitment and conduct of the worker, especially the fitnah of women which was the first fitnah of the Children of Israel and is the most harmful fitnah for the Muslim man, as our Prophet Muhammad (peace and blessings of Allah be upon him) told us. 
If mixing between men and women is something that happens in your country and you can hardly find any job that is free of that, and you think that your being in that job will be beneficial and that you will be able to put a stop to some of that evil and reduce some of it, and you will be able to advise the employees who are under your authority, enjoining them to do what is good and forbidding them to do what is evil as much as you can, and you can take precautions and measure which will help you avoid the fitnah of women – such as hastening to get married if you are not married, not looking at them or being alone with them – and if the work requires you to sit with some of the female employees you can leave the door of the office open and not sit close to them and so on, then we think that your being present in the workplace and achieving some of the interests of Shari`ah and reducing some evils, is better than keeping the workplace devoid of the righteous and leaving it to those who do not pay any attention to religion or to the rulings of Shari`ah, so that these evils become more widespread and it becomes more difficult to fight them. How many teachers and university professors have taught in mixed institutions and Allah has benefited many through them, and warded off a great deal of evil. 
We hope by Allah’s grace that you will be one of them. 
However, if you think, after taking the job, that you cannot adhere to your religious commitment and that you are being pulled into haram gradually, then you have no choice but to leave that job immediately. If a person gives up something for the sake of Allah, Allah will compensate him with something better than it, as the Messenger (peace and blessings of Allah be upon him) said. 
How the Companions earned their living
With regard to the ways in which the Companions (may Allah be pleased with them) earned their living, there were many ways, including:

Trade, as in the case of Abu Bakr As-Siddiq, ‘Uthman ibn ‘Affan and ‘Abd Ar-Rahman ibn ‘Awf (may Allah be pleased with him)
Agriculture, whether they owned farmland or worked on the land; many of the Muhajirin and Ansar were involved in this
Skilled crafts, such as smithery, carpentry and so on
Jobs that were connected to the state, such as teaching, collecting zakah, judging and so on
Earnings acquired through jihad, such as war booty

But there is a great difference between the nature of life, professions and handicrafts at that time, and these things as they are nowadays. But every era is different, as they say. 
Did Prophet Muhammad prefer trade to handicrafts?
With regard to the Prophet (peace and blessings of Allah be upon him) preferring trade to handicrafts , there is no proof for that, as far as we know. There is a difference of opinion among the scholars concerning this issue. Some of them are of the view that business is preferable, and others say that agriculture is preferable, whilst a third group prefers working with one's hands to earn a living, such as handicrafts and so on. 
There is a hadith concerning the virtue of working in trade, but it is not proven. It is the report which says that the Prophet (peace and blessings of Allah be upon him) said: “Nine-tenths of provision is in trade.” (See As-Silsilah al-Da’ifah, 3402) 
Best jobs in Islam
With regard to the report which speaks of the virtue of manufacturing or handicrafts and trade, it was narrated that Rafi’ ibn Khadij (may Allah be pleased with him) said: It was said: O Messenger of Allah, what kind of earning is best? He said: “For a man to work with his hands and every honest transaction.” (Narrated by Ahmad (17265); classed as hasan by the commentators on Al-Musnad; classed as sahih by Al-Albani in Sahih al-Targhib (1691) 
It was narrated from al-Miqdam (may Allah be pleased with him) that the Messenger of Allah (peace and blessings of Allah be upon him) said: “No one ever eats anything better than that which he earned with his own hands. The Prophet of Allah Dawud (peace be upon him) used to eat that which he earned with his own hands.” (Narrated by Al-Bukhari (1966) 
Al-aafiz Ibn Hajar (may Allah be pleased with him): 
“The scholars differed as to the best type of work. Al-Mawardi said: The basic types of earning a living are: agriculture, trade and manufacturing. The most likely view of Ash-Shafi`i is that the best of them is trade. He said: The most correct in my view is that the best of them is agriculture, because it is the closest to tawakkul (putting one’s trust in Allah). 
Al-Nawawi followed it with the hadith of al-Miqdam (quoted above) and said that the correct view is that the best way of earning a living is by working with one’s hands. If it is also in agriculture, then that is the best way of earning a living, because it involves both working with one’s hands and putting one’s trust in Allah, and it benefits both humans and animals, and because usually some of it is given for free.  
I say: Superior to that in things that are done using one's hands is what one acquires of the wealth of the kuffar through jihad. This is how the Prophet (peace and blessings of Allah be upon him) and the Companions earned wealth and it is the noblest way of acquiring wealth, because it is making the word of Allah supreme, suppressing the word of His enemies, and brings benefit in the Hereafter. 
He said: If a person does not work with his hands, then agriculture is best for him, for the reasons we mentioned. 
I say: This is based on the fact that the benefit of agriculture is not limited to the one who practices it. However, that does not apply only to agriculture, rather anything that one does with one’s hands is going to benefit others, because this involves producing things that people need.  
In fact that varies according to circumstances and according to individual cases. And Allah knows best.” (Fath al-Bari, 4/304) 
Based on this, agriculture may be better for one who is more skilled in it than other fields, and manufacturing may be better for one person than for others, and a third person may be better at trading so that is better for him than for others. 
So each person should see what kind of work is suitable for him and what he is best at, and strive to benefit himself and the Muslims through this work. And Allah is the Source of strength. 
And Allah knows best.