What does John 18:17 mean?
Prior verses indicated that John was known to the family of the high priest (John 18:15–16), so when Peter hesitated to come into the courtyard, John was able to get him access. The doorkeeper, however, either recognized Peter's face, or possibly noticed his Galilean accent (Matthew 26:73). Either way, out of suspicion or curiosity, she brings up the possibility of Peter being a follower of Jesus.The phrasing used here is rhetorical. The servant girl expects a "no" answer. In her mind, it would be foolish for someone whose master was under arrest to put himself in harm's way. This was not Jesus' intention, either (John 18:8).
At this point, Peter's posturing takes a dramatic turn. Earlier this same evening, he had claimed willingness to die for Christ (John 13:37). To the credit of his bravery, at least, he attempted to fight back when Jesus was under arrest (John 18:10). And he's secretly followed along to at least see what happens to his Master (Matthew 26:58). Now, under a different kind of threat, and without Christ by his side, Peter gives in to fear. He lies and claims he's not a follower of Christ.
This is what Jesus predicted would happen (John 13:38), and Peter will make this same denial two more times (John 18:25–27).