Krantz in How to Teach Mathematics does actually want to become friends with his students (Sec. 3.1, Breaking the Ice):
Since I so enjoy a class once we have all become friends, I find the
period of tooling up to that happy steady state generally too long and
too painful. What usually happens is that there is a period of two to
five weeks during which the students look at me as though I am from
Mars... You should consider ways to make yourself seem like a human
being to your students... Find some way to open up to your students so
that they will open up to you... My view is that you should show
students from day one that you are a person, and that you are going to
spend the term doing your best to communicate with them.
But elsewhere gives this warning (Section 2.10, Grading):
You do not want to develop the reputation among students as an
instructor with whom grades can be negotiated. I've had this rep, and
I don't know how I got it... This process is unpleasant and (can be)
degrading both for you and the student. Doing a careful job of grading
in the first place, and posting carefully written solutions for
students to see, can help to assuage much of student discomfort with
grades.
Now, Krantz is a teacher "of long experience" (Sec. 3.1), and I can see this being interpreted differently/incorrectly if you are close in age to your students. Also, this will vary based on your institution and quality/maturity of students that you're getting. In my experience at community colleges, the strategy I was forced to start using early on was to be relatively strict at the start of the semester (adamantly not allowing any bit of variation from the course policies when students test them), and then becoming a bit more flexible and friendly later in the semester.
Added: More Krantz (Section 5.9, Begging and Pleading):
It really is true that if you look and/or act like a student then
students will find you more approachable. They will more readily come
to you with propositions that they wouldn't consider broaching with a
more wizened (or older) faculty member. In short, younger faculty are
more vulnerable. This is one reason for dressing differently from
students and maintaining a slight distance. Again, this may sound
cold. But I speak here from hard personal experience.