I think a teacher should be friendly, but not be a friend. They should be friendly encouraged to the righteousness, not forcefully. But they must be friendly convinced about the most important virtues of life!!!
I used to give my students all keys on how to deal with me and my class as well. No friendship is allowed, but I always ask them to stop by my office or contact via email if they have concerns. I used to challenge them, at the same time, I give some directions to find the solution by themselves. I’m very careful to be fair enough with everybody. I used to always smile and tell them real life stories from my experience or readings and how we could use the course’s tools to solve the problems. Respect is always there for everyone.