My manager said I need to shake his hand at any given moment because it is creating a friendly environment. I hate touching people. Do I have to and if I refuse will my job be on the line?
If your manager says it is necessary then it is necessary. In general a handshake is not considered a hostile or sexual touching, and is a quite common sign of respect. If you work with the public, it could be that he wants to show that display of respect to your customers. It could also just be he is the type of person that does not understand personal space.
If this really bothers you, I would suggest explaining to him that it does bother you and that you would prefer to limit personal contact. Its nothing against him it just makes you uncomfortable. If that is not acceptable to him then your only real recourse is to either comply, go to HR, or quit.
If you choose to go to HR, then be prepared to explain why it bothers you. If you have a diagnosed phobia, or some sort of immune system condition this may act in your favor. If his handshakes are different for men, than women, or even just you, they that can create a hostile work environment. That is something HR is more likely to be concerned about. Basically you need a reason for the business to care enough to ask the manager to back down.
But, if your only reason is that you do not like it in general, I would be prepared for the company to back up the manager. Especially if they are successful in their job. And yes, it is possible that your job could be on the line if you complain. In fact is likely to freeze your career with the company, even if they side with you.
You don't have to shake his hand at his apparently random whim. Your job may be at risk, but it certainly ought not to be.
It is clear to me, myself as a former manager, supervisor, tertiary teacher of trade skills to adults, and most relevant of all, as a counsellor to people who are distressed by unprepared-for touch (in my case, counselling people with a minor neurological condition who can otherwise be capable employees) that your manager lacks management training, in particular a most basic part of management training which goes something like: don't invade the personal space of a competent employee; do respect the personal vagaries of an employee - so long as the work is being done up to standard; don't discriminate against an employee because their belief system has minor differences to yours.
Essentially, your manager is being a bully, albeit a subtle one, given that you have revealed that this generally accepted social inter-action is to be inflicted upon you at his whim (not yours). Bullying or torment, call it what you will.
I will put money on it that at your job interview, no mention was made that mandatory handshaking at random times and not by your initiative, was part of the job description.
There is no fault on you. A manager who inflicts distress on his staff in the mistaken belief that it would improve workplace efficiency, should be re-trained or fired.
So, with apologies to those who have suggested that you should get used to handshaking, I must say absolutely not, for the simple reason of the level of distress it causes you. Go to HR and explain politely but firmly and clearly how deeply this matters to you. It is not unknown for an employee's talents to be recognised and yet for a personality clash within a department to sometimes occur. An enlightened company will much prefer a transfer to another department rather than a resignation, followed by months of training a new employee.
If HR offers no satisfaction, think about quietly looking for a new job, if, as I suspect, the feeling is so deep within you that you may never get used to an un-asked for touch. My practical life experience informs me that these feelings can run very deep indeed. On your resume, a resignation is going to look far better than being fired.
FWIW #1: Your manager may possibly have a minor pathology. HR should be talking to him about this and how it adversely affects some employees.
FWIW #2: Short of professional team sports, I don't see any reason for random personal touch at another's sole whim in a workplace.