Nothing can make your work life more difficult than a bad boss, and a two-faced boss is among the worst offenders. A two-faced boss is someone who treats you well to your face but says derogatory things about you when you aren't around. Dealing with a two-faced boss is a tricky situation, but you can do it if you are willing to stand up for yourself in order to make your work life a little better.
Decide if the job is worth keeping. The simplest solution is to find a new place of employment where the working conditions are better. If you decide your job is worth the effort, then you know you need to deal with your two-faced boss in the right way and not in a manner that could cost you your position.
Find the people in power around and above your boss, and make an effort to connect with them. Odds are these are the people who are hearing your boss's derogatory comments about you. By letting them get to know who you really are, you give them the chance to see through the two-faced behavior.
Ask your boss what you can do to improve. Mention that you had heard he wasn't pleased with your recent work, and that you are wondering how you can do better the next time. Ask your boss to provide you with some specific benchmarks you can use to ensure you are meeting expectations. This allows you to call your boss on his or her behavior without a confrontation. It might also force your boss to think about his two-faced behavior; even bosses make mistakes. Addressing it without confrontation or anger gives your boss the benefit of the doubt.
Document things well. Keep a record of what you did or didn't do, of what was expected of you and what you delivered. This is the best way to handle complaints made behind your back. This won't protect you from personal attacks, but it will keep your work above reproach. You should also keep a record of commendations and other positive responses to your work from co-workers and other superiors as a method of responding to criticism.
Bide your time. If your boss is being two-faced with you, odds are good he is being two-faced with other people as well. Eventually, your boss's bad behavior is bound to get him in trouble. In the meantime, if you stay focused on doing your job well, you can hope to advance in your career -- and away from your two-faced boss.
Talk to your human resources department. If the situation has become unbearable and you believe the behavior of your boss is damaging your reputation and chances for advancement, it is best to get a third party involved. Most companies have a system for handling this type of conflict; take advantage of it and follow the procedure.
Sometimes confrontation is necessary -- if your boss's two-faced behavior involves activities such as sexual harassment, it is best to report it to the appropriate authority.
Remember that your boss is still your superior; dealing with conflict in inappropriate ways could be grounds for termination. Always follow company policies.