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