Restrict the root access to SSH service via PAM

Despite every attempt provided in solution, this question couldnt be solved. does anyone whats wrong this question.
Restrict the root access to SSH service via PAM

step. edit the vi /etc/pam.d/sshd
add below line
auth required pam_listfile.so onerr=succeed item=user sense=deny file=/etc/ssh/denied_users
then, need to create a file in /etc/ssh/denied_users with root content in it.
And finally, need to restart sshd service. But still problem is not resolved. Even on verification, root can ssh to system. Anyone please elaborate where i am doing wrong. Thanks

Not sure which lab this is. Please include a link to the lab, so we can see what the deal is here.

https://learn.kodekloud.com/user/courses/red-hat-certified-system-administrator-rhcsa/module/c2d7d0cc-a429-484c-b81b-674ff5fadc7e/lesson/e2697162-3126-48e1-b5cc-144e7f26d186?autoplay=true

Lab: Manage access to the root account and configure PAM

Question#8

I just went through the lab, and the instructions for Q8 do work. I have not tested access (I assume you mean “ssh root@localhost”) which should fail – I did not succeed (I got “password refused”).

What did you try, and what did you expect to see?