For the most part in this chapter, we have discussed how to authenticate and authorize users in MongoDB. However, it is also equally important to ensure that unwanted servers do not get attached to a closed system like replica sets.
In this recipe, we will look at how to achieve inter-server authentication within a MongoDB replica set using key files.