Homework 1.5 Enabling Mixed Authentication Mechanisms

Issue submitting results from validate-hw-1.5.sh.
MemberStatus displayed correct order for replica set
Both user’s displayed with correct _id, role and db.
need help understanding why entry is wrong.

What about unauthorizedStatus?
Your output of json object should have 3 keys

{ unauthorizedStatus: {“ok”:0,“errmsg”:“not authorized on admin to execute command { replSetGetStatus: 1.0 }”,“code”:13}…Json object has 3 keys

Then i suggest you to look at third key i,e users creation and roles
Were you able to connect to DB with the user and client certificate?
Also check db.system.users.find().pretty()

yes i was able to connect to DB with user and client certificate. I did run the command which displayed both accounts

Difficult to say what is wrong without seeing the output of validate
Please search our forum threads.You will get additional clues or Course instructor can help you with 1:1 discussion if needed

Please share the output.

MongoDB Enterprise TO_BE_SECURED:PRIMARY> db.auth(‘will’,’$uperAdmin’)
1
MongoDB Enterprise TO_BE_SECURED:PRIMARY> db.system.users.find().pretty()
{
“_id” : “admin.will”,
“user” : “will”,
“db” : “admin”,
“credentials” : {
“SCRAM-SHA-1” : {
“iterationCount” : 10000,
“salt” : “iEujWP7gd9D8Kcm4Nk/Oew==”,
“storedKey” : “xDKmJiZsH2uRehjnGIqZ5tPq60E=”,
“serverKey” : “wZ0Mt3Z79aE7GnO/VItZjkFFH1c=”
}
},
“roles” : [
{
“role” : “root”,
“db” : “admin”
}
]
}
{
“_id” : “$external.C=US,ST=New York,L=New York City,O=MongoDB,OU=University2,CN=M310 Client”,
“user” : “C=US,ST=New York,L=New York City,O=MongoDB,OU=University2,CN=M310 Client”,
“db” : “$external”,
“credentials” : {
“external” : true
},
“roles” : [
{
“role” : “userAdminAnyDatabase”,
“db” : “admin”
}
]
}

MongoDB Enterprise TO_BE_SECURED:PRIMARY> rs.status()
{
“set” : “TO_BE_SECURED”,
“date” : ISODate(“2021-01-08T15:57:14.907Z”),
“myState” : 1,
“term” : NumberLong(12),
“heartbeatIntervalMillis” : NumberLong(2000),
“members” : [
{
“_id” : 1,
“name” : “database.m310.mongodb.university:31150”,
“health” : 1,
“state” : 1,
“stateStr” : “PRIMARY”,
“uptime” : 228571,
“optime” : {
“ts” : Timestamp(1610121184, 1),
“t” : NumberLong(12)
},
“optimeDate” : ISODate(“2021-01-08T15:53:04Z”),
“electionTime” : Timestamp(1610121183, 1),
“electionDate” : ISODate(“2021-01-08T15:53:03Z”),
“configVersion” : 1,
“self” : true
},
{
“_id” : 2,
“name” : “database.m310.mongodb.university:31151”,
“health” : 1,
“state” : 2,
“stateStr” : “SECONDARY”,
“uptime” : 603,
“optime” : {
“ts” : Timestamp(1610121184, 1),
“t” : NumberLong(12)
},
“optimeDate” : ISODate(“2021-01-08T15:53:04Z”),
“lastHeartbeat” : ISODate(“2021-01-08T15:57:13.933Z”),
“lastHeartbeatRecv” : ISODate(“2021-01-08T15:57:14.866Z”),
“pingMs” : NumberLong(0),
“syncingTo” : “database.m310.mongodb.university:31150”,
“configVersion” : 1
},
{
“_id” : 3,
“name” : “database.m310.mongodb.university:31152”,
“health” : 1,
“state” : 2,
“stateStr” : “SECONDARY”,
“uptime” : 603,
“optime” : {
“ts” : Timestamp(1610121184, 1),
“t” : NumberLong(12)
},
“optimeDate” : ISODate(“2021-01-08T15:53:04Z”),
“lastHeartbeat” : ISODate(“2021-01-08T15:57:13.933Z”),
“lastHeartbeatRecv” : ISODate(“2021-01-08T15:57:14.738Z”),
“pingMs” : NumberLong(0),
“syncingTo” : “database.m310.mongodb.university:31150”,
“configVersion” : 1
}
],
“ok” : 1
}
MongoDB Enterprise TO_BE_SECURED:PRIMARY>

That looks fine. Please share the output of the shell commands:

pwd
ls -l ~/shared