you need to authenticate yourself when you are connecting to mongo instance - for example via mongosh,
mongosh --port 27017 --authenticationDatabase "admin" -u "user" -p "password"
or
mongosh --port 27017
use admin
db.auth("myUserAdmin", passwordPrompt()) // or cleartext password
once you authenticate yourself successfully you can use
db.serverStatus()