How to avoid being falsely accused of harassment by a student?
I am not sure if my experiences are common, but as a faculty member in a psychology department I have had a number of unique and uncomfortable experiences with female students. I have described the two most egregious cases here and here. As for an answer, I want to start with an excerpt from this answer since I think it is so good


  1) Never sexually harass your students. Don't even come close -- have a clear-eyed view of what the boundary of acceptable behavior would be and make sure that you stay two stops on the side of that boundary. Especially, maintain a very strong sense of what is acceptable physical contact with a student. (Handshaking: okay. Tapping someone on their clothed arm or shoulder to get their attention: probably okay, but monitor while you do it to make sure that it is being received that way. Almost anything else: as a rule, don't do it.)


In addition, it is important to think about your behavior. I advise always keeping your door open, and remaining on opposite sides of the desk/table when appropriate. You need to be mindful of physical contact with students (cf. What physical contact, if any, is acceptable between a supervisor and a student?) and what you say to them.

Apart from actually not harassing your students, I advise you to document any awkward interactions you have with students. If you accidently (remember rule 1) inappropriately interact with a student (e.g., physical contact or an odd turn of phrase), regardless of if was you or the student that did/said it, you need to tell someone. Similarly, if a student gets unusually upset about a grade, or anything else, you want to document it. I suggest email so there is a written record. I always told my department chair, but the director of teaching or a faculty mentor could also work. I would advise always telling the same person, so they have some context.

In cases where you know the situation could be difficult or where students have been difficult in the past, you my want to have another faculty member join your meeting. You obviously cannot do this for all meetings (e.g., having a faculty member sit in on all your office hours would not work), it would be fine scheduled meetings with problematic students and difficult situations (e.g., failing a student or academic misconduct).

It is also worth noting that sometimes students want privacy (maybe you are discussing grades or a medical condition). If a student wants to shut my door for privacy, I am fine with it, barring a past history or an obvious difficult situation. If anything uncomfortable happens after the door was shut, or if you are feeling the slightest bit concerned/paranoid, you should document what happened.


  Dear Department Chair,
  
  I met today with Jane Doe to discuss her medical condition. She requested and shut my door while meeting. At one point she briefly came around my desk and showed me the rash on her arm. It was a little odd and in the future I will make sure students know to respect our personal space. I don't foresee any issues, but wanted to keep you in the loop.